avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen McConnell <mcconn...@osm.net>
Subject Re: [A5] CL -> CM -> Component
Date Thu, 13 Jun 2002 16:17:21 GMT

Woops - left out the key bit of what Leo was describing:
(added in-line)

Stephen McConnell wrote:

>
> The the title of this thread as Berin suggested.
>
> Stephen Haberman wrote:
>
>>> Can someone to a newbie check on "You get your *Components* from
>>> the *Service*Locator"?
>>>
>>> I was against ServiceLocator not because I didn't see Components
>>> as being/providing a service, but if we are talking about
>>> Components, then we should apply that name throughout.
>>>   
>>
>>
>> I didn't mean to say I'd like the ServiceLocator name for getting
>> Components. As a newbie, I completely agree that Components should come
>> from a ComponentLocator. I just used the XXXLocator to follow suit with
>> the mail I was responding to.
>>
>>  
>>
>>> The ????????? was called XXXXXManager or "factory" in our previous
>>> discussion.
>>>   
>>
>>
>> If it's already been discussed, I don't mean to bring up an old topic or
>> start any intense debates, but if a XxxManager is pretty much the same
>> as an XxxFactory, I think newbies would "get" the name XxxFactory much
>> more quickly as it's common.
>>
>
> Actually, what Leo's saying makes a lot of sence.
> A5-ComponentLocator returns a component.  That component can be 
> anything.  Leo's example is a component that implements the A4 
> ComponentManager interface (or something equivalent) and as such 
> returns an object the implements the A4 Component interface (or 
> equivalent). That means that a A4-A5 migration could be handled very 
> easily because your changing one line of code in you component when 
> invoking the lookup. The rest of the code base stays the same.
>
> Steve. 


The CL->CM->C snippet from Leo:
-------------------------------


Use the ComponentLocator to get the ComponentManager.
Use the ComponentManager to get the Component.
Once you are done, put the Component back into the ComponentManager.

interface ComponentLocator {
  public Object lookup ();
}

interface ComponentManager {
  public Object getInstance ();
  public void release (Object o);
}

I think this is in line with EJB (XXXHome interface) but with an
explicit release(), as we have not found some kind of release()
unneccesary.

/LS



-- 

Stephen J. McConnell

OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net




--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message