On Fri, 2002-11-15 at 16:02, Stephen McConnell wrote:
<snip>
> >(While it is of course possible to put stuff like this in a Context,
> >using a Configuration is usually easier and more straightforward for
> >data that is naturally represented in XML)

> 
> The above approach only works if the CompanyID value is a static (i.e. 
> declared i a configuration, or context directive or whatever).  If you 
> have a runtime value, you have to (a) create you own DefaultContext and 
> handle a compoent deployment, (b) use a component lifecycle extension, 
> or (c) roll-your-own container.
> 
> Cheer, Steve.

This is exactly the case. In the example, companyID will not be a static
value that I can throw into a config file, it is a runtime value that
will be used during initialization to, for example, pull stuff from a
database under that key.

I understand that components should have a constructor with no arguments
so the container can manage it, but I thought that the component could
get its runtime values from the context in some straightforward way.
Steve, could you please describe (a) and (b) a bit more? What is the
preferred way to do this in avalon? Surely this can't be that uncommon
of a usage pattern....

Thanks for your help.

Regards,

Adam



-- 
Adam Rossi
President, PlatinumSolutions, Inc.
[EMAIL PROTECTED]
http://www.platinumsolutions.com
1610 Washington Plaza North, Reston VA 20190
PH: 703.471.9793  FAX: 703.471.7140


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to