On Wednesday 14 April 2004 00:25, Stephen McConnell wrote:
> 1. the interface we use for locating something (lets call
> it Locator for the purpose of discussion)
Not very important right now.
> 2. the interface used to supply and instance of a Locator
> to a component
Not very important right now.
> 3. the sort of information that a component can include
> in a locate request and the expected behavior of
> container in resolving such a request
> public void someDeliveryMethod( Locator locator )
> {
> Map map = new Hashtable();
> map.put( "color", "red" );
> Football football = locator.locate( Football.class, map );
> }
Suddenly in the land of "Query Languages" :o)
> Possible interpretations:
>
> 1. color is an attribute of a component type
> 2. colour is an attribute of a service implemented by a
> a component type
> 3. color is a feature attributed to a component model
> (i.e. component model x has configuration y and is
> tagged with attribute color=red)
> 4. color is an attribute used by a selection handler
> that knows about the Football class
This shows that the previous assessment that the "hint" and other semantics
were flawed, and needs rectification.
Nevertheless, if 'color' is understood by the Locator and the Locator is
'associated' or 'configured' with the Service and/or component(s), then we
are more into a "Custom Context" type of reasoning.
But then again, for Merlin in the current shape, you can do;
public void service( ServiceManager sm )
{
FootballLocator fbl = (FootballLocator) sm.lookup( "mylocator" );
Football ball = fbl.getBallByColor( "red" );
:
:
}
by making the FootballLocator a Facility, which query the model in whatever
way necessary.
And then technically one could do "Custom Locators" either via "Method
Injection" or "Constructor Injection", like;
public void service( FootballLocator locator )
{
Football ball = locator.getBallByColor( "red" );
}
or
public MyComponent( FootballLocator locator )
{
Football ball = locator.getBallByColor( "red" );
}
I don't know what I think. I still want to hear about more real use-cases to
see what people are really looking for.
Cheers
Niclas
--
+---------//-------------------+
| http://www.bali.ac |
| http://niclas.hedhman.org |
+------//----------------------+
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]