On Wednesday 14 April 2004 15:40, Carsten Ziegeler wrote:

> This key should be a simple string,
> so the above could read:
> locator.locate(Football.class, "red");

Forgive me for a naive question;

What is the difference of the above, from;

servicemanager.lookup( "red-football" );
or
servicemanager.lookup( "/footballs/red" );

Or in the case you need someone else to figure it out;

FootballLocator  fbl = (FootballLocator) sm.lookup( "footballs" );
Football ball = fbl.locate( "red" );

and the 

public class MyOrdinaryComponent 
    implements FootballLocator
{
    private ServiceManager sm;

    public Football locate( String color )
    {
        if( color.equals( "red" ) )
            return (Football) sm.lookup( "red-ball" );
        if( color.equals( "blue" ) )
            return (Football) sm.lookup( "blue-ball" );
        if( color.equals( "green" ) )
            return (Football) sm.lookup( "green-ball" );
        return (Football) sm.lookup( "gray-ball" );
    }
}

I think I don't understand where the Framework needs to be involved, and that 
is what I am trying to understand...

Niclas
-- 
+---------//-------------------+
|   http://www.bali.ac         |
|  http://niclas.hedhman.org   |
+------//----------------------+

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

Reply via email to