No, the Startable components are started as soon as they became eligible to work.
A normal component is not instansitated until someone is requesting it.


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?
 
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 - 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.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of Ayende Rahien
Sent: Tuesday, July 18, 2006 1:23 PM

To: castleproject-users@lists.sourceforge.net
Subject: Re: [Castle-users] Startable facility

You could do a couple of things.
Write a facility that turn all the properties to a mandatory dependencies, so the startable facility will wait until it have everything.
Write a facility like startable, but which waits until it has the optional ones as well.

On 7/18/06, Shawn Hinsey <[EMAIL PROTECTED]> wrote:
Ah, I don't pass the logger in via a constructor, it's coming from a
property in a base class that does a lookup in the container. This makes
sense for the logger, but I do that frequently, for example, my domain
objects (I'm not using Active Record, I use iBATIS) have private
properties that refer to their DAO objects, and those DAOs are obtained
from the container in the same way (i.e.,
ApplicationContext.Current[typeof(IListingDao)] as IListingDao). Is
there any way I can satisfy these dependencies without requiring
constructor injection?

I can sort of do this by tweaking the order in which the components are
declared in the config file, but that seems a little shady to me.

If there's no way to do this with the existing Startable facility, is
there a hook that I could use to write my own that would fire all of the
Start methods after the container had completed its external
configuration? I realize that is a little sketchy given that you can
programmatically configure the container.

It's also worth mentioning that I'm coming at this from a Spring
perspective - I've used spring and spring.net for several years now and
this is my first project with castle/windsor. If I should be looking at
this from another direction, please let me know.

Thanks,
Shawn

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto: [EMAIL PROTECTED]] On Behalf Of
hammett
Sent: Tuesday, July 18, 2006 12:41 PM
To: castleproject-users@lists.sourceforge.net
Subject: Re: [Castle-users] Startable facility

Shawn, the startable facilities "starts" a component whenever it's
ready, but by ready I mean whenever the component has the minimum set of
dependencies satisfied. How are you using the logging, can your
component constructors?


On 7/18/06, Shawn Hinsey <[EMAIL PROTECTED] > wrote:
> I've looked around a little but I am still confused by something about

> the startable facility. It seems like its dependencies aren't being
> resolved. For example, my startable class uses the logging facility,
> but when it starts, the logging facility isn't present in the
container.
> What am I missing?

--
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=DEVDE
V
_______________________________________________
CastleProject-users mailing list
CastleProject-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/castleproject-users

-------------------------------------------------------------------------
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
CastleProject-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/castleproject-users


-------------------------------------------------------------------------
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
CastleProject-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/castleproject-users



-------------------------------------------------------------------------
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
CastleProject-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/castleproject-users

Reply via email to