Berin,

Ok, I made some fixes and changes to the lookup semantics.  I brought it
back in line with what I wanted to begin with.  The purpose of Fortress
is to provide a smooth migration from ECM, and allow you to incorporate
components that could not be incorporated any longer.

It also allows you to simplify your components so that if you do not
need more than one data source component mapped, you do not need to
code for it.

Each code snippet below will work:

//-------------------------------------------------------------
// Returns the default Translator every time.
m_translator = (Translator) m_serviceManager.lookup( Translator.ROLE );


//-------------------------------------------------------------
// Returns the selector to get your Translator
ServiceSelector selector =
    (ServiceSelector)m_serviceManager.lookup(
                                    Translator.ROLE + "Selector" );
m_translator = (Translator) m_serviceManager.select("translator1");


//-------------------------------------------------------------
// Returns the specified translater directly
m_translator = (Translator) m_serviceManager.lookup(
                                Translator.ROLE + "/translator1" );


//-------------------------------------------------------------

I think the guranteed return object is nice. With the variable service/selector return before components that didn't handle it properly could potentially get in trouble after deployment just from config file changes. But, thank God we have an AbstractServiceable implemented that we use for all our Serviceable-s, so we can migrate to this change pretty easily.

This is more in line with the documented "best practices" in
"Developing with Avalon" and the Framework site.  It also has
predictable contracts which are essential to program with.
Can you just state the handling of the hint: "default"? Is it really the first one? What is intended to happen if I have an id="default" as the 2nd component, but id="myid" as the first component and then ask for "default"? Maybe that's why "*" makes more sense.

Shash

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail


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

Reply via email to