On Tue, 4 Mar 2003 18:14, Peter M. Goldstein wrote:
> Finally, I don't know much about the situation where the Avalon container
> is embedded inside another container that exposes DataSources to its hosted
> applications (i.e. Phoenix inside JBoss, Merlin inside Tomcat), but I don't
> believe those DataSources are made available to Avalon components.  Can
> someone clarify this for me?  Thanks.  If they can't be made available,
> then I would add this as another issue on the list below.

It depends on the container of course but there is no reason why a component 
could not be written that that accesses the datasource from JBoss/Tomcate/etc 
and provides it to user (actually thats what the datasource component does 
iirc).

> First, there is no standard way for a component to access a DataSource.
> There is an implicit binding to another component in the system.  So if I
> write a component for one application, and want to reuse it in another, I
> need to ensure that the same method is being used by the second application
> to expose DataSources.  This is a coding and not a configuration level
> issue.  Most other types of containers have made this a configuration level
> issue using JNDI.

Most other containers dont have strong typing. Basically what I would suggest 
is that you create a components whos work interface is DataSource and then 
access it via ServiceManager. For each different datasource needed have a 
different component instance.

> Second, in this set up one generally has to ensure that the component
> supplying the database connections is at the base of the dependency tree.
> In most systems, data stores are fundamental.  So if a database is being
> used, it's important that they be available early.  This isn't a huge deal,
> but it simply adds an extra layer to the dependency declarations.

should be handled by container. Just declare a dependency on it and the 
container should make sure you get it in correct order.

> Fourth, I would imagine there would be situations where the container may
> want access to data sources for its own purposes (i.e. logging).  In the
> current setup container-configured data sources and component-configured
> data sources must be distinct.  This seems sub-optimal.

agreed.

Theres a bunch of ideas kicking around how to implement this but none seem to 
be killer ideas at this stage.

-- 
Cheers,

Peter Donald
USER, n.:
        The word computer professionals use when they mean "idiot."
                        -- Dave Barry, "Claw Your Way to the Top"



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

Reply via email to