On Monday 02 August 2004 22:08, Leo Simons wrote:
Guys, I would really really really like to see a big fat black line
drawn between the "old" and the "new".
What happened to the 'kudos on incremental change path" ?? :o)
O I guess I misphrased :-). Kudos on incremental change in a /new direction/.
I see a big difference between the two proposals! With the availability contract, that's introducing a new concept, a new bit of "COP architecture" that simply wasn't there before. You can introduce this optional new concept to an existing framework application, and nothing will be confusing.
AIUI, Carsten wants to add yet another alternative to the several lookup dictionaries (Context, ServiceManager, ComponentManager). It is not "new architecture", its a subtly different alternative. That was discussed not only a month ago, but a year ago, and two years ago, and three years ago. IMNSHO More important than one answer is having a single answer. Let me write that out.
Q: "I am Joe User. I am new to avalon. I want to write component Foo and use it in container Bladiblah-1.3.32, and have it work in other containers too. This component needs Bar. How does Foo get the reference to Bar?"
A: retrieve it ...
1) from the ServiceManager in the constructor arguments (since 4.2)
2) from the ComponentManager in the constructor arguments (since 4.2)
3) from the ServiceSelector from the ServiceManager in the constructor arguments (since 4.2, not in merlin or phoenix though)
4) from the ComponentSelector from the ComponentManager in the constructor arguments (since 4.2, not in merlin or phoenix though)
5) from the ServiceManager in the service() method of the implemented Serviceable interface (since 4.1)
6) from the ComponentManager in the compose() method of the implemented Composable interface
7) from the ServiceSelector from the ServiceManager in the service() method of the implemented Serviceable interface (since 4.1, not in merlin or phoenix though)
8) from the ComponentSelector from the ComponentManager in the compose() method of the implemented Composable interface (not in merlin or phoenix though)
9) from the Context in the contextualize() method of the implemented Contextualizable interface (probably not in phoenix though)
(...)
10) from the ServiceLocator in the constructor arguments (since 4.5, but not in external implementations like loom)
11) from the ServiceLocator in the locate() method of the implemented LocatorUser interface (since 4.5)
12) from the ServiceSelector from the ServiceLocator in the locate() method of the implemented LocatorUser interface (since 4.5, but not in external implementations like loom and not in merlin or phoenix)
Q: "12 ways for Foo to get at Bar?!? Which one is best?"
A: The current answer is *probably* option #6 (but we don't agree on that and the answer may change in a later framework revision...), using the classname as the lookup key, since that works well in all containers of all versions (The problem of a component not implementing Component was solved nearly immediately after introducing the service package by making use of proxies, which are pretty much accepted practice nowadays). The other 11 options most importantly just increase the learning curve besides offering some small benefits.
Not good.
I would like to constrain the options to something like #5-#9, with strong discouraging of #6-#9. Then, introduce something *new* (if you must) that is clearly different. So the question
"I want to write component Foo. It needs Bar. How do I get the reference?"
now has the answer:
1) retrieve it from the ServiceManager in the service() method of the implemented Serviceable interface (avalon-framework 4.x semantics, works everywhere), or,
2) have it injected using pattern Blah (avalon-framework 5.x semantics, works with container A version x.y, container B version y.z)
3) (there's also some deprecated mechanisms but don't bother reading about it)
from the peanut gallery,
- LSD
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]