On 7/18/06, Shawn Hinsey <[EMAIL PROTECTED]> wrote:
> Is there any sort of decorator attribute that can be used to indicate to the
> container that property is a dependency that needs to be resolved? It
> doesn't seem like I can declaratively wire this dependency in the
> configuration file - am I missing something?

No. The semantics are very clear and natural: constructors means non
optional dependencies; properties are optional dependencies. You can
override that, though, but there's nothing out of the box.

> I'm kind of surprised that this works how it does. It seems like there's no
> difference between a component that implements IStartable and a component
> that initiates its work via a constructor

I'm sorry but there's a big semantic difference. Constructors should
initialize the object to a prepared state, and stop there. An
initializable component acts almost like a windows service as it can
be started and stopped.

> - it seems that both would be
> started at the same time. To me this isn't expected behavior when you're
> dealing with an IoC container. I'd expect the services to be started once
> the component is in a static state.

What's a static state? The container is dynamic, it's always
evaluating its state as it can change. Components can be added,
removed, replaced during the application lifetime.

-- 
Cheers,
hammett
http://hammett.castleproject.org/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

Reply via email to