Peter Royal wrote: > > At 08:29 AM 7/30/2001 -0400, Berin Loritsch wrote: > >Any simple boolean "discovery" methods should never throw an exception. > >It only complicates matters. > > > >There comes two questions for the need for this approach: > > > >1) If we are talking about NEEDED components that the calling Component > > must have in order to work, then we need to strengthen the contract > > between the parent and child Components. The Parent MUST know what > > its children NEED. Anything less is an incorrectly designed system. > > Just an opinion from a user, having such a method would be good, because it > will allow component developers to log potentially more meaningful messages > regarding an incorrect component setup. In our situation here, the > developers that are putting components together may not know as much about > underlying dependencies. Of course, it would be nice for the system to > handle that automagically, which is what I think you are getting at with > your point above. Perhaps something like:
Check out the ExcaliburComponentManager and friends. It doesn't do dependancy checking, but it lets everything be specified easily. > > <role > name="com.pace2020.appbox.framework.components.dataobject.DataFactory" > shorthand="datafactory" > default-class="com.pace2020.appbox.framework.components.dataobject.DataFactoryImpl"> > <depends-on > role="org.apache.avalon.excalibur.datasource.JdbcDataSource"/> > </role> > > <role > name="com.pace2020.appbox.framework.components.dataobject.DataManagerSelector" > shorthand="data-objects" > default-class="org.apache.avalon.excalibur.component.ExcaliburComponentSelector"> > <hint shorthand="relating" > class="com.pace2020.appbox.framework.components.dataobject.RelatingDataManagerImpl"> > <depends-on > role="com.pace2020.appbox.framework.components.dataobject.DataFactory"/> > </hint> > <hint shorthand="singleton" > class="com.pace2020.appbox.framework.components.dataobject.SingletonDataManagerImpl"> > <depends-on > role="com.pace2020.appbox.framework.components.dataobject.DataFactory"/> > </hint> > </role> > > The ComponentManager could then verify that all needed roles have been made > available to it, perhaps before starting to initialize its components? > > I would volunteer to implements something like this, but I embark upon a > vaction next week and we are working towards an industry trade-show in > September. I would be able to dedicate time after that, however. > -peter > > -- > peter royal -> [EMAIL PROTECTED] > managing partners, inc. -> http://www.managingpartners.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
