You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Berin Loritsch <bl...@apache.org> on 2002/06/17 18:11:56 UTC
[A5] CM Use Cases from real requirements
What we need to address is the use cases from several current use cases.
We *have* to address what the best way to solve each use case:
1) Simple CM lookup and use:
This is probably the majority of cases (70%?). A component looks up
another component by interface. It doesn't care about implementation
issues, but it must exist for the component implementation to work.
The current (A4) CM interface accomplishes this without problem.
2) Optional CM lookup and use:
This is less common, but definitely appropriate. A component tests
for the existence of an optional component--which it will use if it
exists. If the component does not exist, it is not exceptional.
This
is in contrast with use case 1 where the missing component *is*
exceptional. The current (A4) CM interface accomplishes this without
problem because of the containsCOmpoennt() method.
3) Non Avalon component lookup and use:
It is easiest to lookup components when you only have one way to
access them. It reduces the complexity of maintaining your system.
If the component being used is a CORBA component, or an EJB bean,
the component should still be able to be resolved. The (A4) SM
interface accomplishes this without problem because it returns
Object instead of Component.
4) Multiple resolutions of an implementation for the same role:
The Container is responsible for this logic. Currently, Phoenix
uses meta-information and a mapping file to manage the Component/
role mapping. However this can be difficult to understand. The
maintainer of a project that someone inherits has a lot of homework
before they can understand how to map roles and components when
there are multiple instances and the returned value changes based
on the context of the calling component. We need a better way to
explain this--because while it is powerful, it is too confusing
for newbies.
5) Multiple resolutions during runtime for the same request:
Nothing really handles this well. It is hacked together by the
component selector/service selector in A4. The problem is best
illustrated by a transformer. A document or transaction can be
processed by several different transformers at runtime before
the request is committed. Two examples include the Cocoon use
case, and my data transformation server. The data transformation
server passes a transaction object which multiple transformers
may be applied to it before it is serialized to the persistence
layer. Cocoon does the same with SAX events. This is what the
proposed lookup(role,hint) hopes to solve.
We need to account for every one of these use cases in a straight-
forward way. The design constraints we should work within should
be:
* Do not force the client to do too much work. The client needs
to be easy to implement. Otherwise A5 is not of any use.
* We should make it conceptually easy--not conceptually hard.
Avalon already suffers from the learning curve necessary between
Component-Oriented Programming and Object Oriented Programming.
* We need to make the containers easy to understand or they will
be forced into obscurity because noone wants to have to debug
a container just to get their component to work.
I think this will provide the proper conceptual framework to design
the nextgen ComponentLocator.
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Stephen McConnell <mc...@osm.net>.
Nicola Ken Barozzi wrote:
>
>
> Stephen McConnell wrote:
>
>>
>> I think we need to take a good long look at usage versus abusage.
>
>
> Good point.
>
> > The
>
>> CM/SM interfaces define a utility through which a container can
>> supply dependent services to a component during the lifecycle
>> processing phase. As soon as you apply supplimentary scope on CM/SM,
>> the probelm expands dramtically and we see the current level of
>> consufion about how the interface is used.
>
>
> It seems so.
>
>> Bottom line - this is easily correctable without modifying the CM/SM
>> lookup signature.
>
>
> I think I start to understand the architectural view of this.
> Since doing a lookup and supplying a constraint can be seen as
> separate concerns (is it this that you say?), it's good practice to
> keep them separate.
Yes.
>
>
> In this way, getting a Selector is not so bad, since it separates the
> role lookup and the selection... *if* we can assume that extra
> constraints told in the selection do not impact dependency resolution...
> hmmm...
[slow drawout yeeeess ....] but alarm bells ringing only becasue my
hunch is that you really want something special - not selctor, but a
special dedication component registry/directory interface that will
scale up with the Coccon application scope. It also provides the
opportunity of moving the problem out of the framework abstraction space.
Steve.
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Nicola Ken Barozzi <ni...@apache.org>.
Stephen McConnell wrote:
>
> I think we need to take a good long look at usage versus abusage.
Good point.
> The
> CM/SM interfaces define a utility through which a container can supply
> dependent services to a component during the lifecycle processing phase.
> As soon as you apply supplimentary scope on CM/SM, the probelm expands
> dramtically and we see the current level of consufion about how the
> interface is used.
It seems so.
> Bottom line - this is easily correctable without modifying the CM/SM
> lookup signature.
I think I start to understand the architectural view of this.
Since doing a lookup and supplying a constraint can be seen as separate
concerns (is it this that you say?), it's good practice to keep them
separate.
In this way, getting a Selector is not so bad, since it separates the
role lookup and the selection... *if* we can assume that extra
constraints told in the selection do not impact dependency resolution...
hmmm...
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Peter Donald <pe...@apache.org>.
On Tue, 18 Jun 2002 22:36, Berin Loritsch wrote:
> > I belive this use case is an abuse of the CM. The CM is a
> > utility supporting interaction between the container and the
> > component. In this context the inteface information is
> > redundant if the container provides support for metadata. If
> > not, the passing of string that is not opaque is a workaround
> > to support either a container or component deficiency. This
> > simple case can be easily support by seperating the usage of
> > a lookup interface for commonent aquistion as opposed to
> > component lifecycle servicing.
>
> Stephen, this is the core use case.
>
> lookup(MyComponent.ROLE);
>
> Nothing more. Read into what you want, but I am talking about
> how it is used NOW.
You mean you use a container that sucks and as a result you have certain
preconceived notions and refuse to listen to any one else.
Gee - thats never happened before ;)
> Sometimes I get the feeling you don't pay attention.
I know you don't. Stephen has not been talking about outlawing optional
components.
> Now that we have taken the junior developer tack, now try explaining
> that to an administrator who wants to override the default mappings
> of component implementations to something different.
You don't need to exlpain it to them if you use a smart container alal Merlin.
> Also, as you have repeatedly demonstrated that while it is not necessary
> to bind the same role name for all components, it is definitely harder
> to follow when you are maintaining your components if one component
> calls
> the SSL ConnectionManager "ConnectionManager.ROLE/SSL" and another calls
> it "ssl-connection". Consistency is very important in maintenance.
And whats the price of fish on Sundays?
> > I think this is a seperate concern - it can be handled by a registry
> > interface that can expose lookup( role, hint, whatever)
> > semantics but is
> > independent of a CM lookup.
>
> How do you really propose to choose the correct Transformer? The
> container (in this case) is also a component responsible for resolving
> a request. The rules for a particular component can require five or
> more different types of transformers.
>
> The important thing is that the component/container needs to resolve
> the correct transformer for the particular stage in the pipeline.
So let the container do it. It aint rocket science.
> > Bottom line - this is easily correctable without modifying the CM/SM
> > lookup signature.
>
> Outline a proposal. Please, enlighten us.
Why would he bother. I have outlined several solutions to this problem - none
of the posts got responses or have even been read it seems. Funnily enough
Leo has also posted much same solution but does not see it. Anyways to
reiterate;
On ComponentSeletor
-------------------
Then:
* (Cocooners): The sky will fall if we dont have it
* Me: Crappy unscalable, unmaintainable solution
Now:
* All: Crappy unscalable, unmaintainable solution
On release()
------------
Then:
* (Cocooners): The sky will fall if we dont have it
* Me: Crappy unscalable, unmaintainable solution
Now:
* All: Crappy unscalable, unmaintainable solution
On MetaInfo stored in code (Component, ThreadSafe etc)
------------------------------------------------------
Then:
* (Cocooners): The sky will fall if we dont have it
* Me: Crappy unscalable, unmaintainable solution
Now:
* All: Crappy unscalable, unmaintainable solution
See a pattern?
Anyways I am done trying to convince you that some of your choices are dumbass
choices leading to pain in future because you wont listen to me anyways ;)
Just a little to think about though. If you try to force others to adopt your
design decisions or foist non-framework stuff for A5 then there will be
blocking or forking.
Anyways return to your scheduled discussion as I can see real progress is
being made now ;)
--
Cheers,
Peter Donald
------------------------------------
The two secrets to success:
1- Don't tell anyone everything.
------------------------------------
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
[OT] Re: Suits
Posted by Leo Simons <le...@apache.org>.
On Tue, 2002-06-18 at 21:16, Leo Sutic wrote:
> > Take of the newbie hat and put on a suite!
>
> Actually, that *is* important. Any code or architecture
> not aligned with business needs is just so much useless
> meat. Suits are *good* for you.
I personally take the stance that suits are bad for business.
Especially if worn by developers.
Nirvana-like architecture is aligned with all sorts of needs.
And that's what we're building, of course.
:-P
> Just thought I'd mention it.
ditto. Software here at apache is not *only* about business needs. Part
of the power of free software...I like that.
(...not that I disagree with anything you said, just placing footnotes)
cheers,
- LSD
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Suits (was: RE: [A5] CM Use Cases from real requirements)
Posted by Leo Sutic <le...@inspireinfrastructure.com>.
> Take of the newbie hat and put on a suite!
Actually, that *is* important. Any code or architecture
not aligned with business needs is just so much useless
meat. Suits are *good* for you.
This goes back to us focusing on usability of Avalon more,
even if our "neat architecture hats" may object.
Witness the behavious of the Cocoon community in regards to
interfaces and architecture. Keep it stable, because people
are actually betting money on it being stable. I like that.
Just thought I'd mention it.
/LS
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: [A5] CM Use Cases from real requirements
Posted by Berin Loritsch <bl...@apache.org>.
> Take of the newbie hat and put on a suite!
<shudder/>
;P
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Stephen McConnell <mc...@osm.net>.
Berin Loritsch wrote:
>>From: Stephen McConnell [mailto:mcconnell@osm.net]
>>
>>Berin Loritsch wrote:
>>
>>
>>
>>>What we need to address is the use cases from several current use
>>>cases. We *have* to address what the best way to solve each use case:
>>>
>>>1) Simple CM lookup and use:
>>> This is probably the majority of cases (70%?). A
>>>
>>>
>>component looks up
>>
>>
>>> another component by interface.
>>>
>>>
>>>
>>I belive this use case is an abuse of the CM. The CM is a
>>utility supporting interaction between the container and the
>>component. In this context the inteface information is
>>redundant if the container provides support for metadata. If
>>not, the passing of string that is not opaque is a workaround
>>to support either a container or component deficiency. This
>>simple case can be easily support by seperating the usage of
>>a lookup interface for commonent aquistion as opposed to
>>component lifecycle servicing.
>>
>>
>
>
>Stephen, this is the core use case.
>
>lookup(MyComponent.ROLE);
>
>Nothing more. Read into what you want, but I am talking about
>how it is used NOW.
>
And my coment was focused on the core use case. The core use case is a
situation where there is information suplied by the client that is
interprised by the container. While that may represent the cure usage
pattern - it does not mean that it is a scalable rational path for
development. In fact, lets be blunt - it isn't. Remove interpritation
of the sting, give the namespace scope to the component - then we are
talking about something we can move forward with. Once this is
recognized - then we can focus on facilitating migration - tools, apis, etc.
>>> It doesn't care about implementation
>>> issues, but it must exist for the component implementation to work. The current (A4) CM interface accomplishes this without problem.
>>>
>>>2) Optional CM lookup and use:
>>> This is less common, but definitely appropriate. A component tests for the existence of an optional component--which it will use if it exists. If the component does not exist, it is not exceptional. This is in contrast with use case 1 where the missing component *is* exceptional. The current (A4) CM interface accomplishes this without problem because of the containsCOmpoennt() method.
>>>
>>>
>>>
>>This is another example of the usage of the CM outside of te scope of
>>component lifecycle management. The real issue here is
>>"should this be part of a CM supported behavior". If it should, then ...
>>
>> a) a component dependency declaration must declare what is
>> effectively a wildcard constraint
>> b) and this constraint could be rejected if it conflict with
>> container policy concerning diclosure of components
>>
>>
>
>??
>
>Sometimes I get the feeling you don't pay attention.
>
<sidenote>
I'm really trying. I don't use Cocoon - I don't use ECM - I do care
about Avalon development -and in particular the framework - that means I
do care about about the Cocoon community. If you have the impression
that I'm not paying attention - then jump in at the appropriate points
and explain what the issue is - what are facts that I'm missing - and as
just about everyione here knows I'm missing lots of information. What
I'm not ready to do is to sit by and watch a re-run of fundimental
mistakes in architecture. Getting this right is important - that means
really assessing the issues - exploring alternatives (even if painful) -
understanding the arguments for and against. Once you arrive at that
position you can figure out if migration is a rationale or not - but at
least you have isolated issues at the architectural level.
</sidenote>
>
>Ok, let me restate it. Let's say I have a component that
>generates information. It _requires_ a SourceResolver
>component. However, if the environment has a Cache component,
>it will use that.
>
>The Cache is not necessary for the generating component to
>opperate--it just allows it to resolve future requests
>quicker.
>
>Therefore, it will check to see if the cache component exists.
>If not, it will continue processing as normal--just without
>the benefit of a cache.
>
>The component will and should be able to function if it is
>used in an environment that does not supply a cache. Artificially
>making it a _requirement_ is a false contract.
>
>
All of this is about poicies that a container applies in the context of
constraints supplied by the client component. You described a scenario
in which a component has a *option* dependecy on a service. We can
ignire the selection relative to multiple providers - that another
topics - what should not be ignored is the responsibility of the
compoent to decare the depedency. Apply queries (via roles, hints, etc)
is the same as case 1 - ok so the client knows its optional - doesn't
change anything as far as a container is concerned. As long as
dependeciues are undeclared is a scenario that is outside of a foral
container/component contract. Try to think of it this way - any time a
client sends something to a container for interpritation (i.e. a
non-opaque string) - your bereaking the generic contract - you
eliminating portability of components - and you limiting applicability
of the container.
>>>4) Multiple resolutions of an implementation for the same role:
>>> The Container is responsible for this logic. Currently, Phoenix
>>> uses meta-information and a mapping file to manage the Component/
>>> role mapping.
>>>
>>>
>>>
>>Merlin also uses meta-information.
>>
>>
>
>I wasn't excluding it.
>
>
>
>
>>> However this can be difficult to understand.
>>>
>>>
>>>
>>Disagree on that. The meta declaration in a .xinfo file is drop dead
>>simple. Its also auto generatable using javadoc tags.
>>Currently Merlin
>>support the complete .xinfo used in Phoenix. Merlin also includes
>>additional information concerning implementation policy and release
>>configuration. This subject (or the convergence of that) are under
>>discussion. Done correctly, this means the ability to fully
>>package a
>>deploy at the component level - and transparent from component to
>>application via Phoenix.
>>
>>
>
>Take off your seasoned developer hat, and put on your newbie hat.
>(Easier said than done, I realize). I have explained it to several
>junior developers many times. Some of them are particularly dense.
>It takes a while for the light bulb to go off in their head.
>
>Now that we have taken the junior developer tack, now try explaining
>that to an administrator who wants to override the default mappings
>of component implementations to something different.
>
1. I'm not a develper.
2. I may be seasoned :-)
3. My own light switch isn't working all the time
*click* *click* *click* - zutt its gone again
4. *click* its working!
Meta is not something that is overriden (its part of the type).
Administator concers will be focussed on declaration of (a) assembly and
(b)
constraints on instances. Even ECM enables declaration of configuration
management. ECM's assembly ins't manageable (because it inside the
component
implementation - whereas the scenaio I'm talking about, all of this is
available for management. It not a code issue. Its not a developer issue
- is a solution much more geared towards management.
Take of the newbie hat and put on a suite!
>>> The maintainer of a project that someone inherits has a lot
>>> of homework before they can understand how to map roles and
>>> components when there are multiple instances and the returned
>>> value changes based on the context of the calling component.
>>>
>>>
>>>
>>The above does not compute.
>>What context are you referring to?
>>
>>
>
>
>Example:
>
>Cocoon. Several sitemaps forming a heirarchy. In each heirarchy the
>component bound to Generator.ROLE/stream might be replaced in a child
>sitemap. Or it can be done somewhere in the middle. I.e. defined in
>the root sitemap, overridden in a child sitemap, and used in a child of
>that sitemap. You have to know the context or scope of the the
>component
>resolution.
>
This is an excellent example of why the Componentmanager.lookup operation
is not the right tool for the job. The application context goes way beyond
the scope of a service/component manager/locator. You are describing much
righer infromation. To handle this you have to seperate yourself from the
framework by at least one step. Use the framework to locate the service
that is capable of supporting these demands.
>
>Also, as you have repeatedly demonstrated that while it is not necessary
>to bind the same role name for all components, it is definitely harder
>to follow when you are maintaining your components if one component
>calls
>the SSL ConnectionManager "ConnectionManager.ROLE/SSL" and another calls
>it "ssl-connection". Consistency is very important in maintenance.
>
Interestingly, in my non-standard approach to life, flying in the face of
established convention and wisdom, challenging the established practices
(which I can assure you I never every though I wouldever do) - it turns
out that my components are completly in control of thier own detiny - they
are self contained - they are not linked computationally to some interfacee
published somewhere with a public static member called ROLE. And what's
even more interesting is that this isn't a problem - becuase in reality
the information isn't needed. It only becomes an issue when your allowing
the container to interprit what you supply. Now you and I know that the
only justifiable excuse for this is that it makes my components consitent
with the other 70% - but so what - my components will not run in either ECM
or Fortress because neither have any notion of a type formally expressing
services or dependencies. So at the end of the day - the upside in
following
the convention amouts to the sum total of zero (well, lets say a sum total
of something rather small - it's actually not zero - but that's another
thread).
>
>
>>> We need a better way to explain this--because while it is
>>> powerful, it is too confusing for newbies.
>>>
>>>
>>>
>>When I first came across Avalon (the project) I spent a lot of time
>>trying to figure out what was available. I did a lot of digging into
>>ECM but found it to be way more complex than Phoenix (and
>>that included all of the pain related to Phoenix assembly stuff).
>>The core bits we are talking about for meta declaration are tiny -
>>simple - very simple - and easy to incorporate into a container. What
>>is really confusing for newbies is runable HelloWorld components (or
>>more specifically the absence of them). I've just finished puttting
>>in place some demos on the Merlin CVS that show simple and composite
>>services - for the developer it is a drop-dead-simple exercise
>>providing they have container solid support.
>>
>>
>
>That is something we need to take care of. However that is a
>documentation concern.
>
>
I think its much more than documentation. You can use decumentation as
a means to rationlize and justify stuff and to eduction, But if you
starting of with something that is clean complete model - the process
becomes much easier. Just think about things like RoleManager - Leo
mentioned that he does not understand it - I know that I don't
understand it (and still dont) - but the important thing is that I know
that I don't need to understand it because I know that in a complete
model it isn't needed. That means the complete model is simpler. That
measn its easier to manage - that means less documentation - that means
higher adoption levels - need I go on?
>
>
>
>
>>>5) Multiple resolutions during runtime for the same request:
>>> Nothing really handles this well. It is hacked together by the
>>> component selector/service selector in A4.
>>>
>>>
>>>
>>Which is basically a workaround pending finalization of a
>>metamodel. I have tools I'm using that give me the suite of
>>options available for given component dependency. From this
>>- you will be able to plug in a selection policy handler that
>>resolves options down to a single service to supply to the
>>component. This seperates the issue of custom policies
>>for an overall meta-management framework.
>>
>>
>>
>>> The problem is best
>>> illustrated by a transformer. A document or transaction can be
>>> processed by several different transformers at runtime before
>>> the request is committed. Two examples include the Cocoon use
>>> case, and my data transformation server. The data transformation
>>> server passes a transaction object which multiple transformers
>>> may be applied to it before it is serialized to the persistence
>>> layer. Cocoon does the same with SAX events. This is what the
>>> proposed lookup(role,hint) hopes to solve.
>>>
>>>
>>>
>>I think this is a seperate concern - it can be handled by a registry
>>interface that can expose lookup( role, hint, whatever)
>>semantics but is independent of a CM lookup.
>>
>>
>
>How do you really propose to choose the correct Transformer? The
>container (in this case) is also a component responsible for resolving
>a request. The rules for a particular component can require five or
>more different types of transformers.
>
The container supplier a service to the component.
The service is a ComponetRegistry that has operations that handle whatever
it is you need to handle this level of complexity. It's basicaly the
same as
what you do now - except that you need to shift this application logic
out of
the component manger astraction layer.
>
>
>The important thing is that the component/container needs to resolve
>the correct transformer for the particular stage in the pipeline.
>
>
And the solution is to shift as much of this into type meta information.
Anything else should be handled by a service, suplied by a component
manager, that handles service resolution for the client. The supplied
service may have a privaliged relationship with the container if you
wish - but the bottom line is that you move the problem from the
abstraction of generic container to component interaction to the
abstract space of the problem - i.e. service query management and
resolution.
>
>
>>>We need to account for every one of these use cases in a straight-
>>>forward way. The design constraints we should work within should
>>>be:
>>>
>>>* Do not force the client to do too much work. The client needs
>>> to be easy to implement. Otherwise A5 is not of any use.
>>>* We should make it conceptually easy--not conceptually hard.
>>> Avalon already suffers from the learning curve necessary between
>>> Component-Oriented Programming and Object Oriented Programming.
>>>* We need to make the containers easy to understand or they will
>>> be forced into obscurity because noone wants to have to debug
>>> a container just to get their component to work.
>>>
>>>I think this will provide the proper conceptual framework to design the nextgen ComponentLocator.
>>>
>>>
>>>
>>I think we need to take a good long look at usage versus
>>abusage. The CM/SM interfaces define a utility through which a container
>>can supply dependent services to a component during the lifecycle
>>processing phase. As soon as you apply supplimentary scope on CM/SM, the
>>probelm expands dramtically and we see the current level of consufion about how the
>>interface is used. Bottom line - this is easily correctable without modifying the CM/SM
>>lookup signature.
>>
>>
>
>Outline a proposal. Please, enlighten us.
>
>
I though I had already done that?
(see other messages in this and related threads).
Cheers, Steve.
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: [A5] CM Use Cases from real requirements
Posted by Berin Loritsch <bl...@apache.org>.
> From: Stephen McConnell [mailto:mcconnell@osm.net]
>
> Berin Loritsch wrote:
>
> >What we need to address is the use cases from several current use
> >cases. We *have* to address what the best way to solve each use case:
> >
> >1) Simple CM lookup and use:
> > This is probably the majority of cases (70%?). A
> component looks up
> > another component by interface.
> >
>
> I belive this use case is an abuse of the CM. The CM is a
> utility supporting interaction between the container and the
> component. In this context the inteface information is
> redundant if the container provides support for metadata. If
> not, the passing of string that is not opaque is a workaround
> to support either a container or component deficiency. This
> simple case can be easily support by seperating the usage of
> a lookup interface for commonent aquistion as opposed to
> component lifecycle servicing.
Stephen, this is the core use case.
lookup(MyComponent.ROLE);
Nothing more. Read into what you want, but I am talking about
how it is used NOW.
>
> > It doesn't care about implementation
> > issues, but it must exist for the component
> implementation to work.
> > The current (A4) CM interface accomplishes this without problem.
> >
> >2) Optional CM lookup and use:
> > This is less common, but definitely appropriate. A
> component tests
> > for the existence of an optional component--which it will
> use if it
> > exists. If the component does not exist, it is not exceptional.
> >This
> > is in contrast with use case 1 where the missing component *is*
> > exceptional. The current (A4) CM interface accomplishes
> this without
> > problem because of the containsCOmpoennt() method.
> >
>
> This is another example of the usage of the CM outside of te scope of
> component lifecycle management. The real issue here is
> "should this be
> part of a CM supported behavior". If it should, then ...
>
> a) a component dependency declaration must declare what is
> effectively a wildcard constraint
> b) and this constraint could be rejected if it conflict with
> container policy concerning diclosure of components
??
Sometimes I get the feeling you don't pay attention.
Ok, let me restate it. Let's say I have a component that
generates information. It _requires_ a SourceResolver
component. However, if the environment has a Cache component,
it will use that.
The Cache is not necessary for the generating component to
opperate--it just allows it to resolve future requests
quicker.
Therefore, it will check to see if the cache component exists.
If not, it will continue processing as normal--just without
the benefit of a cache.
The component will and should be able to function if it is
used in an environment that does not supply a cache. Artificially
making it a _requirement_ is a false contract.
> >4) Multiple resolutions of an implementation for the same role:
> > The Container is responsible for this logic. Currently, Phoenix
> > uses meta-information and a mapping file to manage the Component/
> > role mapping.
> >
>
> Merlin also uses meta-information.
I wasn't excluding it.
> > However this can be difficult to understand.
> >
>
> Disagree on that. The meta declaration in a .xinfo file is drop dead
> simple. Its also auto generatable using javadoc tags.
> Currently Merlin
> support the complete .xinfo used in Phoenix. Merlin also includes
> additional information concerning implementation policy and release
> configuration. This subject (or the convergence of that) are under
> discussion. Done correctly, this means the ability to fully
> package a
> deploy at the component level - and transparent from component to
> application via Phoenix.
Take off your seasoned developer hat, and put on your newbie hat.
(Easier said than done, I realize). I have explained it to several
junior developers many times. Some of them are particularly dense.
It takes a while for the light bulb to go off in their head.
Now that we have taken the junior developer tack, now try explaining
that to an administrator who wants to override the default mappings
of component implementations to something different.
> > The
> > maintainer of a project that someone inherits has a lot
> of homework
> > before they can understand how to map roles and components when
> > there are multiple instances and the returned value changes based
> > on the context of the calling component.
> >
>
> The above does not compute.
> What context are you referring to?
Example:
Cocoon. Several sitemaps forming a heirarchy. In each heirarchy the
component bound to Generator.ROLE/stream might be replaced in a child
sitemap. Or it can be done somewhere in the middle. I.e. defined in
the root sitemap, overridden in a child sitemap, and used in a child of
that sitemap. You have to know the context or scope of the the
component
resolution.
Also, as you have repeatedly demonstrated that while it is not necessary
to bind the same role name for all components, it is definitely harder
to follow when you are maintaining your components if one component
calls
the SSL ConnectionManager "ConnectionManager.ROLE/SSL" and another calls
it "ssl-connection". Consistency is very important in maintenance.
> > We need a better way to
> > explain this--because while it is powerful, it is too confusing
> > for newbies.
> >
>
> When I first came across Avalon (the project) I spent a lot of time
> trying to figure out what was available. I did a lot of digging into
> ECM but found it to me way more complex than Phoenix (and
> that included
> all of the pain related to Phoenix assembly stuff). The core bots we
> are talking about for mewta declaration are tiny - simple -
> very simple
> - and easy to incorporate into a container. What is really
> confusing for
> newbies is runable HelloWorld components (or more specifically the
> absence of them). I've just finished put in place some demod on the
> Merlin CVS that show simple and composite services - for the
> developer
> is a drop-dead-simple exercise providing they have container
> solid support.
That is something we need to take care of. However that is a
documentation
concern.
> >5) Multiple resolutions during runtime for the same request:
> > Nothing really handles this well. It is hacked together by the
> > component selector/service selector in A4.
> >
>
> Which is basically a workaround pending finalization of a
> metamodel. I
> have tools I'm using that give me the suite of options available for
> given component dependency. From this - you will be able to
> plug in a
> selection policy handler that resolves options down to a
> single service
> to supply to the component. This seperates the issue of
> custom policies
> for an overall meta-management framework.
>
> > The problem is best
> > illustrated by a transformer. A document or transaction can be
> > processed by several different transformers at runtime before
> > the request is committed. Two examples include the Cocoon use
> > case, and my data transformation server. The data transformation
> > server passes a transaction object which multiple transformers
> > may be applied to it before it is serialized to the persistence
> > layer. Cocoon does the same with SAX events. This is what the
> > proposed lookup(role,hint) hopes to solve.
> >
>
> I think this is a seperate concern - it can be handled by a registry
> interface that can expose lookup( role, hint, whatever)
> semantics but is
> independent of a CM lookup.
How do you really propose to choose the correct Transformer? The
container (in this case) is also a component responsible for resolving
a request. The rules for a particular component can require five or
more different types of transformers.
The important thing is that the component/container needs to resolve
the correct transformer for the particular stage in the pipeline.
>
> >
> >We need to account for every one of these use cases in a straight-
> >forward way. The design constraints we should work within should
> >be:
> >
> >* Do not force the client to do too much work. The client needs
> > to be easy to implement. Otherwise A5 is not of any use.
> >* We should make it conceptually easy--not conceptually hard.
> > Avalon already suffers from the learning curve necessary between
> > Component-Oriented Programming and Object Oriented Programming.
> >* We need to make the containers easy to understand or they will
> > be forced into obscurity because noone wants to have to debug
> > a container just to get their component to work.
> >
> >I think this will provide the proper conceptual framework to
> design the
> >nextgen ComponentLocator.
> >
>
> I think we need to take a good long look at usage versus
> abusage. The
> CM/SM interfaces define a utility through which a container
> can supply
> dependent services to a component during the lifecycle
> processing phase.
> As soon as you apply supplimentary scope on CM/SM, the
> probelm expands
> dramtically and we see the current level of consufion about how the
> interface is used.
>
> Bottom line - this is easily correctable without modifying the CM/SM
> lookup signature.
Outline a proposal. Please, enlighten us.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Stephen McConnell <mc...@osm.net>.
Berin Loritsch wrote:
>What we need to address is the use cases from several current use cases.
>We *have* to address what the best way to solve each use case:
>
>1) Simple CM lookup and use:
> This is probably the majority of cases (70%?). A component looks up
> another component by interface.
>
I belive this use case is an abuse of the CM. The CM is a utility
supporting interaction between the container and the component. In
this context the inteface information is redundant if the container
provides support for metadata. If not, the passing of string that is
not opaque is a workaround to support either a container or component
deficiency. This simple case can be easily support by seperating the
usage of a lookup interface for commonent aquistion as opposed to
component lifecycle servicing.
> It doesn't care about implementation
> issues, but it must exist for the component implementation to work.
> The current (A4) CM interface accomplishes this without problem.
>
>2) Optional CM lookup and use:
> This is less common, but definitely appropriate. A component tests
> for the existence of an optional component--which it will use if it
> exists. If the component does not exist, it is not exceptional.
>This
> is in contrast with use case 1 where the missing component *is*
> exceptional. The current (A4) CM interface accomplishes this without
> problem because of the containsCOmpoennt() method.
>
This is another example of the usage of the CM outside of te scope of
component lifecycle management. The real issue here is "should this be
part of a CM supported behavior". If it should, then ...
a) a component dependency declaration must declare what is
effectively a wildcard constraint
b) and this constraint could be rejected if it conflict with
container policy concerning diclosure of components
>
>
>3) Non Avalon component lookup and use:
> It is easiest to lookup components when you only have one way to
> access them. It reduces the complexity of maintaining your system.
> If the component being used is a CORBA component, or an EJB bean,
> the component should still be able to be resolved. The (A4) SM
> interface accomplishes this without problem because it returns
> Object instead of Component.
>
>4) Multiple resolutions of an implementation for the same role:
> The Container is responsible for this logic. Currently, Phoenix
> uses meta-information and a mapping file to manage the Component/
> role mapping.
>
Merlin also uses meta-information.
> However this can be difficult to understand.
>
Disagree on that. The meta declaration in a .xinfo file is drop dead
simple. Its also auto generatable using javadoc tags. Currently Merlin
support the complete .xinfo used in Phoenix. Merlin also includes
additional information concerning implementation policy and release
configuration. This subject (or the convergence of that) are under
discussion. Done correctly, this means the ability to fully package a
deploy at the component level - and transparent from component to
application via Phoenix.
> The
> maintainer of a project that someone inherits has a lot of homework
> before they can understand how to map roles and components when
> there are multiple instances and the returned value changes based
> on the context of the calling component.
>
The above does not compute.
What context are you referring to?
> We need a better way to
> explain this--because while it is powerful, it is too confusing
> for newbies.
>
When I first came across Avalon (the project) I spent a lot of time
trying to figure out what was available. I did a lot of digging into
ECM but found it to me way more complex than Phoenix (and that included
all of the pain related to Phoenix assembly stuff). The core bots we
are talking about for mewta declaration are tiny - simple - very simple
- and easy to incorporate into a container. What is really confusing for
newbies is runable HelloWorld components (or more specifically the
absence of them). I've just finished put in place some demod on the
Merlin CVS that show simple and composite services - for the developer
is a drop-dead-simple exercise providing they have container solid support.
>
>
>5) Multiple resolutions during runtime for the same request:
> Nothing really handles this well. It is hacked together by the
> component selector/service selector in A4.
>
Which is basically a workaround pending finalization of a metamodel. I
have tools I'm using that give me the suite of options available for
given component dependency. From this - you will be able to plug in a
selection policy handler that resolves options down to a single service
to supply to the component. This seperates the issue of custom policies
for an overall meta-management framework.
> The problem is best
> illustrated by a transformer. A document or transaction can be
> processed by several different transformers at runtime before
> the request is committed. Two examples include the Cocoon use
> case, and my data transformation server. The data transformation
> server passes a transaction object which multiple transformers
> may be applied to it before it is serialized to the persistence
> layer. Cocoon does the same with SAX events. This is what the
> proposed lookup(role,hint) hopes to solve.
>
I think this is a seperate concern - it can be handled by a registry
interface that can expose lookup( role, hint, whatever) semantics but is
independent of a CM lookup.
>
>We need to account for every one of these use cases in a straight-
>forward way. The design constraints we should work within should
>be:
>
>* Do not force the client to do too much work. The client needs
> to be easy to implement. Otherwise A5 is not of any use.
>* We should make it conceptually easy--not conceptually hard.
> Avalon already suffers from the learning curve necessary between
> Component-Oriented Programming and Object Oriented Programming.
>* We need to make the containers easy to understand or they will
> be forced into obscurity because noone wants to have to debug
> a container just to get their component to work.
>
>I think this will provide the proper conceptual framework to design
>the nextgen ComponentLocator.
>
I think we need to take a good long look at usage versus abusage. The
CM/SM interfaces define a utility through which a container can supply
dependent services to a component during the lifecycle processing phase.
As soon as you apply supplimentary scope on CM/SM, the probelm expands
dramtically and we see the current level of consufion about how the
interface is used.
Bottom line - this is easily correctable without modifying the CM/SM
lookup signature.
Cheers, Steve.
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Nicola Ken Barozzi <ni...@apache.org>.
Leo Sutic wrote:
> I aim to solve case 5 first, and then show how this would work
> together with my previous proposal of about an hour ago.
>
> 1) lookup (role) == lookup (role, null)
>
> 2) Assign each component in the container a container-wide unique id
> of type String. Auto-generate this id if not supplied by user.
>
> 3) Define an interface, ComponentSelector, that maps from hints
> to ids.
>
> interface ComponentSelector {
> // hint == null means default component.
> public String select (Object hint) throws ComponentException;
> }
>
> 4) Let lookup(role,hint) be:
>
> Object component = lookup (role);
> if (component instanceof ComponentSelector) {
> String componentId = ((ComponentSelector) component).select
> (hint);
> return lookupById (componentId);
> } else {
> return component;
> }
:-)
Very nice.
I think that it's basically in line with what we were getting to, ie
role+constraint, but has the indoubt quality of keeping the same
interfaces *and* the indipendent Selector.
As we have said, "hint" would be better described as "constraint", but a
String? Hmmm...
Anyway, this proposal solves many issues I see, interesting.
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Stephen McConnell <mc...@osm.net>.
And a bit of ascii art to reinforce what I said earlier:
|------------------------------------| |---------|
| ComponentRegistry |<--->| client |
| Serves component requests | |---------|
|------------------------------------|
^
| uses container to
| create new components
v
|-----------------------------------|
| container |
| |
| |
| creates and prepares components |
| using CM/SM which are private to |
| the container and the component |
| implementation |
| |
|-----------------------------------|
Cheers, Steve.
Stephen McConnell wrote:
>
> I'm starting to think that maybe we are all making a subtile
> mistake. Hang-in-there and I'll explain myself. If we look
> at the different scenarios its clear that several of us are
> doing similar things but at the same time they are really
> different (I think everyone is going to agree with that). So,
> I've been trying to figure out what is is - and I think I am
> reaching a conclusion.
> In the context of Cocoon (which I don't know much about), it
> appears that ECM is being used as an object repository. A
> sitemap processor is basically invoking lookup on ECM to get
> the pre-configured components that it wants. From all of the
> discussion so far, it seems to me that ECM is serving these
> request out of the lookup operation - and I think this is
> breaking the thinking pattern - and potential solutions.
>
> Let me explain:
>
> Imagine we design a modern, clean container. Imagine that
> the lookup operations is *never* exposed to anything but a
> component instance that has been instantiated by the container,
> and to which the container has supplied a component manager.
> In this situation, the component manager knows the classname
> of the component, know lookup labels based on the components
> meta-info, knows the service to include in the supplied manager,
> can basically take care of everything to completely satisfy the
> component. HOWEVER, how does the container serve request for
> components to a client?
>
> Given the lookup retriction imposed above - it can't. So, what
> we would do (in our hyperthentical new container) is to seperate
> the concerns of container as a source of components, from
> container as a manager of the components it instantiates.
>
> E.g. a simple object registry interface (that happens to look a lot
> like CM) that could be used as the interface through which Cocoon
> get componets using roles (interface name / whatever).
>
> public interface ComponentRegistry()
> {
> boolean hasComponent( String role );
>
> Object lookup( String role ) throws RegistryException;
> }
>
> By seperating the concerns, we are now free to address the best way
> for a client (e.g. Cocoon sitemap processor) could invoke queries to
> get a component. We can add constraint, roles, hints, lipstick,
> whatever - it does not matter because we are not dealing with the
> lookup semantic of the CM/SM interfaces. Furthermore, this can be
> completely in sync with ECM patterns ensuring totally smooth
> migration.
>
> Cheers, Steve.
>
>
> Leo Sutic wrote:
>
>> I aim to solve case 5 first, and then show how this would work
>> together with my previous proposal of about an hour ago.
>>
>> 1) lookup (role) == lookup (role, null)
>>
>> 2) Assign each component in the container a container-wide unique id
>> of type String. Auto-generate this id if not supplied by user.
>>
>> 3) Define an interface, ComponentSelector, that maps from hints
>> to ids.
>>
>> interface ComponentSelector {
>> // hint == null means default component.
>> public String select (Object hint) throws ComponentException;
>> }
>>
>> 4) Let lookup(role,hint) be:
>>
>> Object component = lookup (role);
>> if (component instanceof ComponentSelector) {
>> String componentId = ((ComponentSelector) component).select
>> (hint);
>> return lookupById (componentId);
>> } else {
>> return component;
>> }
>> So, if there is a ComponentSelector mapped to the requested
>> role,
>> use it to get the id of the implementation, and then get the
>> implementation by id. If there isn't a ComponentSelector mapped
>> to the requested role - that is, you have done a lookup (role, hint)
>> and there's no selector - return the component you found (hint is
>> ignored). If hint is null the selector will give you the default
>> implementation, so lookup(role) works, even if there is a
>> selector mapped to the role name.
>>
>> For example, Cocoon needs to select a suitable Transformer depending
>> on the target device, which for simplicity is either HTML or WML:
>>
>> <component role="Transformer"
>> class="DeviceSelector">
>> <hint key="wml" id="wmltransformer"/>
>> <default id="htmltransformer"/>
>> </component>
>>
>> <component id="wmltransformer" role="Transformer/WML"
>> class="WMLTransformer"/>
>>
>> <component id="htmltransformer" role="Transformer/HTML"
>> class="HTMLTransformer"/>
>>
>> In the example above, the hints are simple string->id mappings,
>> but you could easily have more complex hint->id mappings. They
>> are specific for each type of selector.
>>
>> How does this solve the use cases?
>>
>>
>>
>>> 1) Simple CM lookup and use
>>> 2) Optional CM lookup and use.
>>> 3) Non Avalon component lookup and use
>>> 4) Multiple resolutions of an implementation for the same role
>>>
>>
>>
>> Unchanged. Only difference being that you *can* use a selector
>> without the component doing the lookup knowing it.
>>
>>
>>
>>> 5) Multiple resolutions during runtime for the same request
>>>
>>
>>
>> Solved. Selectors are made pluggable parts of the container,
>> meaning that the client need not code specifically for them. The
>> container only needs to test if it has looked up a selector
>> and then apply the hint, shifting the burden of interpreting the
>> hint away from the container writer.
>>
>>
>>
>>> * Do not force the client to do too much work. The client needs
>>> to be easy to implement. Otherwise A5 is not of any use.
>>>
>>
>>
>> I think this is as easy as it gets. It is A4, but without need-to-know
>> about selectors when you code.
>>
>>
>>
>>> * We should make it conceptually easy--not conceptually hard.
>>> Avalon already suffers from the learning curve necessary between
>>> Component-Oriented Programming and Object Oriented Programming.
>>>
>>
>>
>> *Now this* is a problem. I think a quick tutorial can solve it, though.
>> If you just have ComponentLocator, Component, and ComponentSelector,
>> it should be possible to explain that ComponentLocator deals with
>> roles and that the ComponentSelector deals with hints and provide
>> pluggable resolution abilities for containers.
>>
>>
>>
>>> * We need to make the containers easy to understand or they will
>>> be forced into obscurity because noone wants to have to debug
>>> a container just to get their component to work.
>>>
>>
>>
>> True.
>>
>> I therefor think that we must allow for case 1 to work without
>> any configuration info or metadata. It should be really easy
>> to set up simple role->impl mappings. That is why I do not
>> require the user to assign id's to all components. I would
>> like to make role optional also (it being equal to id if not
>> specified == you can only get this component via a selector.)
>>
>> Fire away.
>>
>> /LS
>>
>>
>>
>>
>>> -----Original Message-----
>>> From: Berin Loritsch [mailto:bloritsch@apache.org] Sent: den 17 juni
>>> 2002 18:12
>>> To: 'Avalon Developers List'
>>> Subject: [A5] CM Use Cases from real requirements
>>>
>>>
>>> What we need to address is the use cases from several current use
>>> cases. We *have* to address what the best way to solve each use case:
>>>
>>> This is probably the majority of cases (70%?). A component looks up
>>> another component by interface. It doesn't care about implementation
>>> issues, but it must exist for the component implementation to work.
>>> The current (A4) CM interface accomplishes this without problem.
>>>
>>> This is less common, but definitely appropriate. A component tests
>>> for the existence of an optional component--which it will use if it
>>> exists. If the component does not exist, it is not exceptional. This
>>> is in contrast with use case 1 where the missing component *is*
>>> exceptional. The current (A4) CM interface accomplishes this without
>>> problem because of the containsCOmpoennt() method.
>>>
>>>
>>
>> :
>>
>>
>>> It is easiest to lookup components when you only have one way to
>>> access them. It reduces the complexity of maintaining your system.
>>> If the component being used is a CORBA component, or an EJB bean,
>>> the component should still be able to be resolved. The (A4) SM
>>> interface accomplishes this without problem because it returns
>>> Object instead of Component.
>>>
>>>
>>
>> :
>>
>>
>>> The Container is responsible for this logic. Currently, Phoenix
>>> uses meta-information and a mapping file to manage the Component/
>>> role mapping. However this can be difficult to understand. The
>>> maintainer of a project that someone inherits has a lot of homework
>>> before they can understand how to map roles and components when
>>> there are multiple instances and the returned value changes based
>>> on the context of the calling component. We need a better way to
>>> explain this--because while it is powerful, it is too confusing
>>> for newbies.
>>>
>>>
>>
>> :
>>
>>
>>> Nothing really handles this well. It is hacked together by the
>>> component selector/service selector in A4. The problem is best
>>> illustrated by a transformer. A document or transaction can be
>>> processed by several different transformers at runtime before
>>> the request is committed. Two examples include the Cocoon use
>>> case, and my data transformation server. The data transformation
>>> server passes a transaction object which multiple transformers
>>> may be applied to it before it is serialized to the persistence
>>> layer. Cocoon does the same with SAX events. This is what the
>>> proposed lookup(role,hint) hopes to solve.
>>>
>>> We need to account for every one of these use cases in a straight-
>>> forward way. The design constraints we should work within should
>>> be:
>>>
>>>
>>> I think this will provide the proper conceptual framework to design
>>> the nextgen ComponentLocator.
>>>
>>>
>>> "They that give up essential liberty to obtain a little temporary
>>> safety deserve neither liberty nor safety."
>>> - Benjamin Franklin
>>>
>>>
>>> --
>>> To unsubscribe, e-mail: <mailto:avalon-dev->
>>> unsubscribe@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>>>
>>>
>>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>>
>>
>
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Stephen McConnell <mc...@osm.net>.
Leo Sutic wrote:
>
>
>>From: Stephen McConnell [mailto:mcconnell@osm.net]
>>
>>Leo Sutic wrote:
>>
>>
>>
>>>Stephen,
>>>
>>>1) What will the CM interface look like? I think you just end
>>> up back where you started...
>>>
>>>
>>>
>>>
>>I've been using the CM term relative to Avalon 4
>>ComponentManager, or, Avalon 4 ServiceLocator or
>>ServiceManager as a A4 migration path.
>>
>>
>
>I'm talking about the CM interface in your drawing. The little
>box labeled "CM".
>
>
Thats the component manager supplied by the container to the component.
>
>
>>>2) what is the difference between ComponentRegistry and a
>>> ComponentSelector?
>>>
>>>
>>>
>>The important difference is the the ComponentRegistry is not
>>part of the
>>Avalon Framework, its just a service interface, possibly
>>something that
>>could live in Excalibur land. The actual operations exposed by that
>>interface could then be crafted to match the ECM/Cocoon/Fortress
>>application space - e.g. it would extend from Component (to
>>be backward
>>compatible with CM), and it would contain a suite of lookup
>>operations
>>that leverage structured roles, hints, queries, whatever the
>>ECM/Fortress/Cocoon community think is rational (i.e.
>>minimise migration
>>headaches).
>>
>>Sound good?
>>
>>
>
>Not really... I think you are pushing too much to the client.
>It would appear that for most normal use cases, the client needs
>to supply a ComponentRegistry.
>
>
Think of ComponentRegistry as the thing the handles service requests
(i.e. lookup strings are interprited).
>What we end up with is a framework that isn't constrained *enough* -
>there's no point in using it, as you end up having to code very
>much yourself anyway.
>
>
Bring in the notion of an intemidiate ComponentRegistry provides a
solution that parrallels ECM/Fortress approaches but enables coponent
that fully publish their contracts (via meta) to use a component manager
with pure container/component semantics. Its a strategy that will enable
painless migration.
>Overall this is a problem with the A5 effort - in an effort to
>get cleaner architecture, we have very much removed the ease of
>use of A4. In A5 you need to write your own XXXXManagers, your own
>ComponentRegistry, etc., etc... Basically, you are saying that
>
I have the impression your missunderstanding the function of a component
registry. This is simply something very similar to that part of ECM and
Fortress that handles lookup with a string value that is interprited by
the container (as opposued to the use of a lookup string which is an
opaque key). The registry is built by the container and provided by the
container, specifically to serve those components that have embedded
deopedency information inside lookup argument values (instead of
declaring this as part of meta).
>
> for the single most common use case of the framework,
> the framework will not provide any formalized interfaces,
> at all!
>
>Everything is pushed onto the client in some bizzare interpretation
>of SoC. This is not SoC, it's a gaping hole in Avalon's feature set.
>If that separates anything it separates potential users from the
>framework.
>
>
Not following the last bit.
Let's clean up the understanding of the approach I'm decribing - then
when that's clear - we can talk about gaping holes and feature sets.
Cheers, Steve.
>/LS
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: [A5] CM Use Cases from real requirements
Posted by Leo Sutic <le...@inspireinfrastructure.com>.
> From: Stephen McConnell [mailto:mcconnell@osm.net]
>
> Leo Sutic wrote:
>
> >Stephen,
> >
> > 1) What will the CM interface look like? I think you just end
> > up back where you started...
> >
> >
>
> I've been using the CM term relative to Avalon 4
> ComponentManager, or, Avalon 4 ServiceLocator or
> ServiceManager as a A4 migration path.
I'm talking about the CM interface in your drawing. The little
box labeled "CM".
> > 2) what is the difference between ComponentRegistry and a
> > ComponentSelector?
> >
>
> The important difference is the the ComponentRegistry is not
> part of the
> Avalon Framework, its just a service interface, possibly
> something that
> could live in Excalibur land. The actual operations exposed by that
> interface could then be crafted to match the ECM/Cocoon/Fortress
> application space - e.g. it would extend from Component (to
> be backward
> compatible with CM), and it would contain a suite of lookup
> operations
> that leverage structured roles, hints, queries, whatever the
> ECM/Fortress/Cocoon community think is rational (i.e.
> minimise migration
> headaches).
>
> Sound good?
Not really... I think you are pushing too much to the client.
It would appear that for most normal use cases, the client needs
to supply a ComponentRegistry.
What we end up with is a framework that isn't constrained *enough* -
there's no point in using it, as you end up having to code very
much yourself anyway.
Overall this is a problem with the A5 effort - in an effort to
get cleaner architecture, we have very much removed the ease of
use of A4. In A5 you need to write your own XXXXManagers, your own
ComponentRegistry, etc., etc... Basically, you are saying that
for the single most common use case of the framework,
the framework will not provide any formalized interfaces,
at all!
Everything is pushed onto the client in some bizzare interpretation
of SoC. This is not SoC, it's a gaping hole in Avalon's feature set.
If that separates anything it separates potential users from the
framework.
/LS
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Stephen McConnell <mc...@osm.net>.
Leo Sutic wrote:
>Stephen,
>
> 1) What will the CM interface look like? I think you just end
> up back where you started...
>
>
I've been using the CM term relative to Avalon 4 ComponentManager,
or, Avalon 4 ServiceLocator or ServiceManager as a A4 migration
path.
>
> 2) what is the difference between ComponentRegistry and a
> ComponentSelector?
>
The important difference is the the ComponentRegistry is not part of the
Avalon Framework, its just a service interface, possibly something that
could live in Excalibur land. The actual operations exposed by that
interface could then be crafted to match the ECM/Cocoon/Fortress
application space - e.g. it would extend from Component (to be backward
compatible with CM), and it would contain a suite of lookup operations
that leverage structured roles, hints, queries, whatever the
ECM/Fortress/Cocoon community think is rational (i.e. minimise migration
headaches).
> 3) Could you go through Berin's use cases and show how this
> looks like from a component's point of view?
>
Case 1:
Supplying an interface name to lookup on CM - this is a query that
should be resolved through a ComponentRegistry (and I know that's
painful) - its the only way to seperate the concerns.
Case 2:
Optional CM lookup - no change from current practice - you would
lookup the service you want on a ComponentRegistry in the same way
you currently lookup the component on a CM.
Case 4:
Component that declare dependencies - this has come into ECM or
Fortress scope sooner or later otherwise services with dependencies
will never be usable in that scope. In this context, a component in
ECM/Fortress declaring a dependecy will lookup that service directly
in the CM supplied to it.
Case 5:
Resolution of a selection of multiple services - for non-meta enabled
components - the component implementation would supply constraints
(role/hint/query/whatever) against a ComponentRegistry. I the
meta-enabled case, the container would do the resolution of a single
selection and supply this directly to the CM.
>
>It's nice and all, but:
>
> + We *still* have that CM interface there... Since that is
> all that the component will see, the ComponentRegistry/container
> part is hidden.
>
Let's look at the impact - ECM based components (i.e. components that
lookup a service by supply the arguments for interpritation by the
container) continue to use ECM. Components migrating from ECM to
Fortress or Merlin should either:
(a) get a reference to a ComponetRepository via the
ComponentManager before invoking an interprited lookup
on the ComponetRepository service
(b) update the component to declare dependencies, in which
case the usage pattern between component and CM would
be direct (no intermidiate ComponetRepository stuff - the
component would access the services directly via the CM)
From the above migration path, current ECM components will
progressively become more and more meta-enabled (declaration of services
provider and dependecies). This will result in broader applicability of
these component. For example, they will be usable in Merlin as services
that higher level component can depend on. Merlin components will be
usable as providers of dependent services in the Cocoon world.
I think the number 1 biggest benefit is that it will result in the
inevitable convergence of Fortress and Merlin and Phoenix - where we
differentiate in terms of the type of component maangement problems but
we share a standard framework for things like:
- component type repositories
- classloader management
- jar extension library management
- automated assembly graph creation
- dynamic component type addition
- policy management framework for type and instance selection
- component and assembly instantiation and valdation
- security policy management
- auto documentation tools
Sound good?
Cheers, Steve.
>
>
>/LS
>
>
>
>>-----Original Message-----
>>From: Stephen McConnell [mailto:mcconnell@osm.net]
>>Sent: den 18 juni 2002 10:51
>>To: Avalon Developers List
>>Subject: Re: [A5] CM Use Cases from real requirements
>>
>>
>>
>>Which implies the following:
>>
>> |-----------------------------------|
>> | container |
>> | |
>> | | creates |-----------|
>> | creates and prepares components | -------------> | component |
>> | using CM/SM which are private to | | |
>> | the container and the component | | |
>> | implementation | | |
>> | | | |
>> |-----------------------------------| | |
>> ^ | |
>> | uses container to | |
>> | create new components | |
>> v | |
>> |------------------------------------| |-----| | |
>> | ComponentRegistry |---->| CM |<--| |
>> | Serves component requests | |-----| | |
>> | | | |
>> | | query | |
>> | | <------------ | |
>> | | | |
>> | | service | |
>> | | -----------> | |
>> |------------------------------------| |-----------|
>>
>>
>>Stephen McConnell wrote:
>>
>>
>>
>>>Vadim Gritsenko wrote:
>>>
>>>
>>>
>>>>>From: Stephen McConnell [mailto:mcconnell@osm.net]
>>>>>
>>>>>
>>>>>
>>>><snip/>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>In the context of Cocoon (which I don't know much about),
>>>>>
>>>>>
>>it appears
>>
>>
>>>>>that ECM is being used as an object repository. A
>>>>>
>>>>>
>>sitemap processor
>>
>>
>>>>>is basically invoking lookup on ECM to get the pre-configured
>>>>>components that it wants. From all of the discussion so far, it
>>>>>seems to me that ECM is serving these request out of the lookup
>>>>>operation - and I think this is breaking the thinking
>>>>>
>>>>>
>>pattern - and
>>
>>
>>>>>potential solutions.
>>>>>
>>>>>Let me explain:
>>>>>
>>>>>Imagine we design a modern, clean container. Imagine that the
>>>>>lookup operations is *never* exposed to anything but a component
>>>>>instance that has been instantiated by the container, and
>>>>>
>>>>>
>>to which
>>
>>
>>>>>the container has supplied a component manager. In this
>>>>>
>>>>>
>>situation,
>>
>>
>>>>>the component manager knows the classname of the component, know
>>>>>lookup labels based on the components meta-info, knows
>>>>>
>>>>>
>>the service
>>
>>
>>>>>to include in the supplied manager, can basically take care of
>>>>>everything to completely satisfy the component. HOWEVER,
>>>>>
>>>>>
>>how does
>>
>>
>>>>>the container serve request for components to a client?
>>>>>
>>>>>
>>>>>
>>>>Stephen,
>>>>
>>>>Let me correct you a bit before somebody else does :)
>>>>
>>>>
>>>>
>>>Given my knowledge of Cocoon and ECM - yep - I'm open to
>>>corrections:
>>>
>>>:-)
>>>
>>>
>>>
>>>>Cocoon's sitemap processor *is* a component, managed by the
>>>>container, and instantiated by container, and provided
>>>>
>>>>
>>with component
>>
>>
>>>>manager by container.
>>>>
>>>>
>>>>
>>>>
>>>Mechanically - yes - but the very fact that ECM does not deal with
>>>dependencies means that component is responsible for component
>>>selection via a query (as distinct from Merlin/Phoenix where the
>>>container does the selection and handes the compoent only what it
>>>needs).
>>>
>>>Problem is that the semantic that are assumed in ECM are that the
>>>component
>>>under composition is free to ask for any service - which
>>>
>>>
>>means that the
>>
>>
>>>model of interaction is that the component being serviced
>>>
>>>
>>is acting as a
>>
>>
>>>client towards a component registry. In this model, restrictions to
>>>scalability are infurred by the expresssiness of the
>>>
>>>
>>repository lookup
>>
>>
>>>interface (in ECM the ComponentManager interface is being
>>>
>>>
>>used as the
>>
>>
>>>repository query interface). This is the important distinction.
>>>
>>>Workarounds to this include the ComponentSelector - enabling the
>>>client to
>>>enter into a finer-grain of selection semantics. As the application
>>>complexity grows, debate on additional parameters on the
>>>
>>>
>>lookup operation
>>
>>
>>>emerge as solutions to the problem. In fact, the problem
>>>
>>>
>>is that the
>>
>>
>>>manager is being used as a repository. If we can figure a way of
>>>breaking
>>>out of this usage pattern then life will become a lot easier.
>>>
>>>I sure the following will raise a torrent of objections, but its an
>>>example of seperating concerns:
>>>
>>> 1. Component manager check component type it is instantiating
>>> for its formal, contractual dependecies - if available, the
>>> the manager provides only these service in the service
>>> manager.
>>>
>>> 2. If the component implements composable/serviceable and no
>>> dependecies are declared - we can assume (a) its a broken
>>> component, or (b) its a component that is implicity
>>> requesting a component repository service.
>>>
>>> I.e. component composable imp:
>>>
>>> public void lookup( String role )
>>> {
>>> ComponentRepository rep = (ComponentRepository)lookup(
>>> ComponentRepository.ROLE );
>>>
>>> final String role = Something.ROLE; Query
>>>query = getQuery();
>>> Object object = rep.query( role, query );
>>> }
>>>
>>>Cheers, Steve.
>>>
>>>
>>>
>>--
>>
>>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: <ma...@jakarta.apache.org>
>>
>>
>>
>>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: [A5] CM Use Cases from real requirements
Posted by Leo Sutic <le...@inspireinfrastructure.com>.
Stephen,
1) What will the CM interface look like? I think you just end
up back where you started...
2) what is the difference between ComponentRegistry and a
ComponentSelector?
3) Could you go through Berin's use cases and show how this
looks like from a component's point of view?
It's nice and all, but:
+ We *still* have that CM interface there... Since that is
all that the component will see, the ComponentRegistry/container
part is hidden.
/LS
> -----Original Message-----
> From: Stephen McConnell [mailto:mcconnell@osm.net]
> Sent: den 18 juni 2002 10:51
> To: Avalon Developers List
> Subject: Re: [A5] CM Use Cases from real requirements
>
>
>
> Which implies the following:
>
> |-----------------------------------|
> | container |
> | |
> | | creates |-----------|
> | creates and prepares components | -------------> | component |
> | using CM/SM which are private to | | |
> | the container and the component | | |
> | implementation | | |
> | | | |
> |-----------------------------------| | |
> ^ | |
> | uses container to | |
> | create new components | |
> v | |
> |------------------------------------| |-----| | |
> | ComponentRegistry |---->| CM |<--| |
> | Serves component requests | |-----| | |
> | | | |
> | | query | |
> | | <------------ | |
> | | | |
> | | service | |
> | | -----------> | |
> |------------------------------------| |-----------|
>
>
> Stephen McConnell wrote:
>
> >
> >
> > Vadim Gritsenko wrote:
> >
> >>> From: Stephen McConnell [mailto:mcconnell@osm.net]
> >>>
> >>
> >>
> >> <snip/>
> >>
> >>
> >>
> >>> In the context of Cocoon (which I don't know much about),
> it appears
> >>> that ECM is being used as an object repository. A
> sitemap processor
> >>> is basically invoking lookup on ECM to get the pre-configured
> >>> components that it wants. From all of the discussion so far, it
> >>> seems to me that ECM is serving these request out of the lookup
> >>> operation - and I think this is breaking the thinking
> pattern - and
> >>> potential solutions.
> >>>
> >>> Let me explain:
> >>>
> >>> Imagine we design a modern, clean container. Imagine that the
> >>> lookup operations is *never* exposed to anything but a component
> >>> instance that has been instantiated by the container, and
> to which
> >>> the container has supplied a component manager. In this
> situation,
> >>> the component manager knows the classname of the component, know
> >>> lookup labels based on the components meta-info, knows
> the service
> >>> to include in the supplied manager, can basically take care of
> >>> everything to completely satisfy the component. HOWEVER,
> how does
> >>> the container serve request for components to a client?
> >>>
> >>
> >>
> >> Stephen,
> >>
> >> Let me correct you a bit before somebody else does :)
> >>
> >
> > Given my knowledge of Cocoon and ECM - yep - I'm open to
> > corrections:
> >
> > :-)
> >
> >>
> >>
> >> Cocoon's sitemap processor *is* a component, managed by the
> >> container, and instantiated by container, and provided
> with component
> >> manager by container.
> >>
> >>
> >
> > Mechanically - yes - but the very fact that ECM does not deal with
> > dependencies means that component is responsible for component
> > selection via a query (as distinct from Merlin/Phoenix where the
> > container does the selection and handes the compoent only what it
> > needs).
> >
> > Problem is that the semantic that are assumed in ECM are that the
> > component
> > under composition is free to ask for any service - which
> means that the
> > model of interaction is that the component being serviced
> is acting as a
> > client towards a component registry. In this model, restrictions to
> > scalability are infurred by the expresssiness of the
> repository lookup
> > interface (in ECM the ComponentManager interface is being
> used as the
> > repository query interface). This is the important distinction.
> >
> > Workarounds to this include the ComponentSelector - enabling the
> > client to
> > enter into a finer-grain of selection semantics. As the application
> > complexity grows, debate on additional parameters on the
> lookup operation
> > emerge as solutions to the problem. In fact, the problem
> is that the
> > manager is being used as a repository. If we can figure a way of
> > breaking
> > out of this usage pattern then life will become a lot easier.
> >
> > I sure the following will raise a torrent of objections, but its an
> > example of seperating concerns:
> >
> > 1. Component manager check component type it is instantiating
> > for its formal, contractual dependecies - if available, the
> > the manager provides only these service in the service
> > manager.
> >
> > 2. If the component implements composable/serviceable and no
> > dependecies are declared - we can assume (a) its a broken
> > component, or (b) its a component that is implicity
> > requesting a component repository service.
> >
> > I.e. component composable imp:
> >
> > public void lookup( String role )
> > {
> > ComponentRepository rep = (ComponentRepository)lookup(
> > ComponentRepository.ROLE );
> >
> > final String role = Something.ROLE; Query
> > query = getQuery();
> > Object object = rep.query( role, query );
> > }
> >
> > Cheers, Steve.
> >
>
> --
>
> 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: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Stephen McConnell <mc...@osm.net>.
Which implies the following:
|-----------------------------------|
| container |
| |
| | creates |-----------|
| creates and prepares components | -------------> | component |
| using CM/SM which are private to | | |
| the container and the component | | |
| implementation | | |
| | | |
|-----------------------------------| | |
^ | |
| uses container to | |
| create new components | |
v | |
|------------------------------------| |-----| | |
| ComponentRegistry |---->| CM |<--| |
| Serves component requests | |-----| | |
| | | |
| | query | |
| | <------------ | |
| | | |
| | service | |
| | -----------> | |
|------------------------------------| |-----------|
Stephen McConnell wrote:
>
>
> Vadim Gritsenko wrote:
>
>>> From: Stephen McConnell [mailto:mcconnell@osm.net]
>>>
>>
>>
>> <snip/>
>>
>>
>>
>>> In the context of Cocoon (which I don't know much about), it
>>> appears that ECM is being used as an object repository. A
>>> sitemap processor is basically invoking lookup on ECM to get
>>> the pre-configured components that it wants. From all of the
>>> discussion so far, it seems to me that ECM is serving these
>>> request out of the lookup operation - and I think this is
>>> breaking the thinking pattern - and potential solutions.
>>>
>>> Let me explain:
>>>
>>> Imagine we design a modern, clean container. Imagine that
>>> the lookup operations is *never* exposed to anything but a
>>> component instance that has been instantiated by the container,
>>> and to which the container has supplied a component manager.
>>> In this situation, the component manager knows the classname
>>> of the component, know lookup labels based on the components
>>> meta-info, knows the service to include in the supplied manager,
>>> can basically take care of everything to completely satisfy the
>>> component. HOWEVER, how does the container serve request for
>>> components to a client?
>>>
>>
>>
>> Stephen,
>>
>> Let me correct you a bit before somebody else does :)
>>
>
> Given my knowledge of Cocoon and ECM - yep - I'm open to
> corrections:
>
> :-)
>
>>
>>
>> Cocoon's sitemap processor *is* a component, managed by the container,
>> and instantiated by container, and provided with component manager by
>> container.
>>
>>
>
> Mechanically - yes - but the very fact that ECM does not deal with
> dependencies means that component is responsible for component selection
> via a query (as distinct from Merlin/Phoenix where the container does the
> selection and handes the compoent only what it needs).
>
> Problem is that the semantic that are assumed in ECM are that the
> component
> under composition is free to ask for any service - which means that the
> model of interaction is that the component being serviced is acting as a
> client towards a component registry. In this model, restrictions to
> scalability are infurred by the expresssiness of the repository lookup
> interface (in ECM the ComponentManager interface is being used as the
> repository query interface). This is the important distinction.
>
> Workarounds to this include the ComponentSelector - enabling the
> client to
> enter into a finer-grain of selection semantics. As the application
> complexity grows, debate on additional parameters on the lookup operation
> emerge as solutions to the problem. In fact, the problem is that the
> manager is being used as a repository. If we can figure a way of
> breaking
> out of this usage pattern then life will become a lot easier.
>
> I sure the following will raise a torrent of objections, but its an
> example of seperating concerns:
>
> 1. Component manager check component type it is instantiating
> for its formal, contractual dependecies - if available, the
> the manager provides only these service in the service
> manager.
>
> 2. If the component implements composable/serviceable and no
> dependecies are declared - we can assume (a) its a broken
> component, or (b) its a component that is implicity
> requesting a component repository service.
>
> I.e. component composable imp:
>
> public void lookup( String role )
> {
> ComponentRepository rep = (ComponentRepository)lookup(
> ComponentRepository.ROLE );
>
> final String role = Something.ROLE; Query
> query = getQuery();
> Object object = rep.query( role, query );
> }
>
> Cheers, Steve.
>
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Stephen McConnell <mc...@osm.net>.
Vadim Gritsenko wrote:
>>From: Stephen McConnell [mailto:mcconnell@osm.net]
>>
>>
>
><snip/>
>
>
>
>>In the context of Cocoon (which I don't know much about), it
>>appears that ECM is being used as an object repository. A
>>sitemap processor is basically invoking lookup on ECM to get
>>the pre-configured components that it wants. From all of the
>>discussion so far, it seems to me that ECM is serving these
>>request out of the lookup operation - and I think this is
>>breaking the thinking pattern - and potential solutions.
>>
>>Let me explain:
>>
>>Imagine we design a modern, clean container. Imagine that
>>the lookup operations is *never* exposed to anything but a
>>component instance that has been instantiated by the container,
>>and to which the container has supplied a component manager.
>>In this situation, the component manager knows the classname
>>of the component, know lookup labels based on the components
>>meta-info, knows the service to include in the supplied manager,
>>can basically take care of everything to completely satisfy the
>>component. HOWEVER, how does the container serve request for
>>components to a client?
>>
>>
>
>Stephen,
>
>Let me correct you a bit before somebody else does :)
>
Given my knowledge of Cocoon and ECM - yep - I'm open to
corrections:
:-)
>
>
>Cocoon's sitemap processor *is* a component, managed by the container,
>and instantiated by container, and provided with component manager by
>container.
>
>
Mechanically - yes - but the very fact that ECM does not deal with
dependencies means that component is responsible for component selection
via a query (as distinct from Merlin/Phoenix where the container does the
selection and handes the compoent only what it needs).
Problem is that the semantic that are assumed in ECM are that the component
under composition is free to ask for any service - which means that the
model of interaction is that the component being serviced is acting as a
client towards a component registry. In this model, restrictions to
scalability are infurred by the expresssiness of the repository lookup
interface (in ECM the ComponentManager interface is being used as the
repository query interface). This is the important distinction.
Workarounds to this include the ComponentSelector - enabling the client to
enter into a finer-grain of selection semantics. As the application
complexity grows, debate on additional parameters on the lookup operation
emerge as solutions to the problem. In fact, the problem is that the
manager is being used as a repository. If we can figure a way of breaking
out of this usage pattern then life will become a lot easier.
I sure the following will raise a torrent of objections, but its an
example of seperating concerns:
1. Component manager check component type it is instantiating
for its formal, contractual dependecies - if available, the
the manager provides only these service in the service
manager.
2. If the component implements composable/serviceable and no
dependecies are declared - we can assume (a) its a broken
component, or (b) its a component that is implicity
requesting a component repository service.
I.e. component composable imp:
public void lookup( String role )
{
ComponentRepository rep = (ComponentRepository)lookup(
ComponentRepository.ROLE );
final String role = Something.ROLE;
Query query = getQuery();
Object object = rep.query( role, query );
}
Cheers, Steve.
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: [A5] CM Use Cases from real requirements
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Stephen McConnell [mailto:mcconnell@osm.net]
<snip/>
> In the context of Cocoon (which I don't know much about), it
> appears that ECM is being used as an object repository. A
> sitemap processor is basically invoking lookup on ECM to get
> the pre-configured components that it wants. From all of the
> discussion so far, it seems to me that ECM is serving these
> request out of the lookup operation - and I think this is
> breaking the thinking pattern - and potential solutions.
>
> Let me explain:
>
> Imagine we design a modern, clean container. Imagine that
> the lookup operations is *never* exposed to anything but a
> component instance that has been instantiated by the container,
> and to which the container has supplied a component manager.
> In this situation, the component manager knows the classname
> of the component, know lookup labels based on the components
> meta-info, knows the service to include in the supplied manager,
> can basically take care of everything to completely satisfy the
> component. HOWEVER, how does the container serve request for
> components to a client?
Stephen,
Let me correct you a bit before somebody else does :)
Cocoon's sitemap processor *is* a component, managed by the container,
and instantiated by container, and provided with component manager by
container.
Vadim
<snip/>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [A5] CM Use Cases from real requirements
Posted by Stephen McConnell <mc...@osm.net>.
I'm starting to think that maybe we are all making a subtile
mistake. Hang-in-there and I'll explain myself. If we look
at the different scenarios its clear that several of us are
doing similar things but at the same time they are really
different (I think everyone is going to agree with that). So,
I've been trying to figure out what is is - and I think I am
reaching a conclusion.
In the context of Cocoon (which I don't know much about), it
appears that ECM is being used as an object repository. A
sitemap processor is basically invoking lookup on ECM to get
the pre-configured components that it wants. From all of the
discussion so far, it seems to me that ECM is serving these
request out of the lookup operation - and I think this is
breaking the thinking pattern - and potential solutions.
Let me explain:
Imagine we design a modern, clean container. Imagine that
the lookup operations is *never* exposed to anything but a
component instance that has been instantiated by the container,
and to which the container has supplied a component manager.
In this situation, the component manager knows the classname
of the component, know lookup labels based on the components
meta-info, knows the service to include in the supplied manager,
can basically take care of everything to completely satisfy the
component. HOWEVER, how does the container serve request for
components to a client?
Given the lookup retriction imposed above - it can't. So, what
we would do (in our hyperthentical new container) is to seperate
the concerns of container as a source of components, from
container as a manager of the components it instantiates.
E.g. a simple object registry interface (that happens to look a lot
like CM) that could be used as the interface through which Cocoon
get componets using roles (interface name / whatever).
public interface ComponentRegistry()
{
boolean hasComponent( String role );
Object lookup( String role ) throws RegistryException;
}
By seperating the concerns, we are now free to address the best way
for a client (e.g. Cocoon sitemap processor) could invoke queries to
get a component. We can add constraint, roles, hints, lipstick,
whatever - it does not matter because we are not dealing with the
lookup semantic of the CM/SM interfaces. Furthermore, this can be
completely in sync with ECM patterns ensuring totally smooth
migration.
Cheers, Steve.
Leo Sutic wrote:
>I aim to solve case 5 first, and then show how this would work
>together with my previous proposal of about an hour ago.
>
> 1) lookup (role) == lookup (role, null)
>
> 2) Assign each component in the container a container-wide unique id
> of type String. Auto-generate this id if not supplied by user.
>
> 3) Define an interface, ComponentSelector, that maps from hints
> to ids.
>
> interface ComponentSelector {
> // hint == null means default component.
> public String select (Object hint) throws ComponentException;
> }
>
> 4) Let lookup(role,hint) be:
>
> Object component = lookup (role);
> if (component instanceof ComponentSelector) {
> String componentId = ((ComponentSelector) component).select
>(hint);
> return lookupById (componentId);
> } else {
> return component;
> }
>
> So, if there is a ComponentSelector mapped to the requested role,
> use it to get the id of the implementation, and then get the
> implementation by id. If there isn't a ComponentSelector mapped
> to the requested role - that is, you have done a lookup (role, hint)
> and there's no selector - return the component you found (hint is
> ignored). If hint is null the selector will give you the default
> implementation, so lookup(role) works, even if there is a
> selector mapped to the role name.
>
>For example, Cocoon needs to select a suitable Transformer depending
>on the target device, which for simplicity is either HTML or WML:
>
> <component role="Transformer"
> class="DeviceSelector">
> <hint key="wml" id="wmltransformer"/>
> <default id="htmltransformer"/>
> </component>
>
> <component id="wmltransformer" role="Transformer/WML"
> class="WMLTransformer"/>
>
> <component id="htmltransformer" role="Transformer/HTML"
> class="HTMLTransformer"/>
>
>In the example above, the hints are simple string->id mappings,
>but you could easily have more complex hint->id mappings. They
>are specific for each type of selector.
>
>How does this solve the use cases?
>
>
>
>>1) Simple CM lookup and use
>>2) Optional CM lookup and use.
>>3) Non Avalon component lookup and use
>>4) Multiple resolutions of an implementation for the same role
>>
>>
>
>Unchanged. Only difference being that you *can* use a selector
>without the component doing the lookup knowing it.
>
>
>
>>5) Multiple resolutions during runtime for the same request
>>
>>
>
>Solved. Selectors are made pluggable parts of the container,
>meaning that the client need not code specifically for them. The
>container only needs to test if it has looked up a selector
>and then apply the hint, shifting the burden of interpreting the
>hint away from the container writer.
>
>
>
>>* Do not force the client to do too much work. The client needs
>> to be easy to implement. Otherwise A5 is not of any use.
>>
>>
>
>I think this is as easy as it gets. It is A4, but without need-to-know
>about selectors when you code.
>
>
>
>>* We should make it conceptually easy--not conceptually hard.
>> Avalon already suffers from the learning curve necessary between
>> Component-Oriented Programming and Object Oriented Programming.
>>
>>
>
>*Now this* is a problem. I think a quick tutorial can solve it, though.
>If you just have ComponentLocator, Component, and ComponentSelector,
>it should be possible to explain that ComponentLocator deals with
>roles and that the ComponentSelector deals with hints and provide
>pluggable resolution abilities for containers.
>
>
>
>>* We need to make the containers easy to understand or they will
>> be forced into obscurity because noone wants to have to debug
>> a container just to get their component to work.
>>
>>
>
>True.
>
>I therefor think that we must allow for case 1 to work without
>any configuration info or metadata. It should be really easy
>to set up simple role->impl mappings. That is why I do not
>require the user to assign id's to all components. I would
>like to make role optional also (it being equal to id if not
>specified == you can only get this component via a selector.)
>
>Fire away.
>
>/LS
>
>
>
>
>>-----Original Message-----
>>From: Berin Loritsch [mailto:bloritsch@apache.org]
>>Sent: den 17 juni 2002 18:12
>>To: 'Avalon Developers List'
>>Subject: [A5] CM Use Cases from real requirements
>>
>>
>>What we need to address is the use cases from several current
>>use cases. We *have* to address what the best way to solve
>>each use case:
>>
>> This is probably the majority of cases (70%?). A
>>component looks up
>> another component by interface. It doesn't care about
>>implementation
>> issues, but it must exist for the component implementation to work.
>> The current (A4) CM interface accomplishes this without problem.
>>
>> This is less common, but definitely appropriate. A component tests
>> for the existence of an optional component--which it will use if it
>> exists. If the component does not exist, it is not
>>exceptional. This
>> is in contrast with use case 1 where the missing component *is*
>> exceptional. The current (A4) CM interface accomplishes
>>this without
>> problem because of the containsCOmpoennt() method.
>>
>>
>>
>:
>
>
>> It is easiest to lookup components when you only have one way to
>> access them. It reduces the complexity of maintaining your system.
>> If the component being used is a CORBA component, or an EJB bean,
>> the component should still be able to be resolved. The (A4) SM
>> interface accomplishes this without problem because it returns
>> Object instead of Component.
>>
>>
>>
>:
>
>
>> The Container is responsible for this logic. Currently, Phoenix
>> uses meta-information and a mapping file to manage the Component/
>> role mapping. However this can be difficult to understand. The
>> maintainer of a project that someone inherits has a lot of homework
>> before they can understand how to map roles and components when
>> there are multiple instances and the returned value changes based
>> on the context of the calling component. We need a better way to
>> explain this--because while it is powerful, it is too confusing
>> for newbies.
>>
>>
>>
>:
>
>
>> Nothing really handles this well. It is hacked together by the
>> component selector/service selector in A4. The problem is best
>> illustrated by a transformer. A document or transaction can be
>> processed by several different transformers at runtime before
>> the request is committed. Two examples include the Cocoon use
>> case, and my data transformation server. The data transformation
>> server passes a transaction object which multiple transformers
>> may be applied to it before it is serialized to the persistence
>> layer. Cocoon does the same with SAX events. This is what the
>> proposed lookup(role,hint) hopes to solve.
>>
>>We need to account for every one of these use cases in a
>>straight- forward way. The design constraints we should work
>>within should
>>be:
>>
>>
>>I think this will provide the proper conceptual framework to
>>design the nextgen ComponentLocator.
>>
>>
>>"They that give up essential liberty to obtain a little
>>temporary safety deserve neither liberty nor safety."
>> - Benjamin Franklin
>>
>>
>>--
>>To unsubscribe, e-mail:
>><mailto:avalon-dev-> unsubscribe@jakarta.apache.org>
>>For
>>additional commands,
>>e-mail: <ma...@jakarta.apache.org>
>>
>>
>>
>>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: [A5] CM Use Cases from real requirements
Posted by Leo Sutic <le...@inspireinfrastructure.com>.
I aim to solve case 5 first, and then show how this would work
together with my previous proposal of about an hour ago.
1) lookup (role) == lookup (role, null)
2) Assign each component in the container a container-wide unique id
of type String. Auto-generate this id if not supplied by user.
3) Define an interface, ComponentSelector, that maps from hints
to ids.
interface ComponentSelector {
// hint == null means default component.
public String select (Object hint) throws ComponentException;
}
4) Let lookup(role,hint) be:
Object component = lookup (role);
if (component instanceof ComponentSelector) {
String componentId = ((ComponentSelector) component).select
(hint);
return lookupById (componentId);
} else {
return component;
}
So, if there is a ComponentSelector mapped to the requested role,
use it to get the id of the implementation, and then get the
implementation by id. If there isn't a ComponentSelector mapped
to the requested role - that is, you have done a lookup (role, hint)
and there's no selector - return the component you found (hint is
ignored). If hint is null the selector will give you the default
implementation, so lookup(role) works, even if there is a
selector mapped to the role name.
For example, Cocoon needs to select a suitable Transformer depending
on the target device, which for simplicity is either HTML or WML:
<component role="Transformer"
class="DeviceSelector">
<hint key="wml" id="wmltransformer"/>
<default id="htmltransformer"/>
</component>
<component id="wmltransformer" role="Transformer/WML"
class="WMLTransformer"/>
<component id="htmltransformer" role="Transformer/HTML"
class="HTMLTransformer"/>
In the example above, the hints are simple string->id mappings,
but you could easily have more complex hint->id mappings. They
are specific for each type of selector.
How does this solve the use cases?
> 1) Simple CM lookup and use
> 2) Optional CM lookup and use.
> 3) Non Avalon component lookup and use
> 4) Multiple resolutions of an implementation for the same role
Unchanged. Only difference being that you *can* use a selector
without the component doing the lookup knowing it.
> 5) Multiple resolutions during runtime for the same request
Solved. Selectors are made pluggable parts of the container,
meaning that the client need not code specifically for them. The
container only needs to test if it has looked up a selector
and then apply the hint, shifting the burden of interpreting the
hint away from the container writer.
> * Do not force the client to do too much work. The client needs
> to be easy to implement. Otherwise A5 is not of any use.
I think this is as easy as it gets. It is A4, but without need-to-know
about selectors when you code.
> * We should make it conceptually easy--not conceptually hard.
> Avalon already suffers from the learning curve necessary between
> Component-Oriented Programming and Object Oriented Programming.
*Now this* is a problem. I think a quick tutorial can solve it, though.
If you just have ComponentLocator, Component, and ComponentSelector,
it should be possible to explain that ComponentLocator deals with
roles and that the ComponentSelector deals with hints and provide
pluggable resolution abilities for containers.
> * We need to make the containers easy to understand or they will
> be forced into obscurity because noone wants to have to debug
> a container just to get their component to work.
True.
I therefor think that we must allow for case 1 to work without
any configuration info or metadata. It should be really easy
to set up simple role->impl mappings. That is why I do not
require the user to assign id's to all components. I would
like to make role optional also (it being equal to id if not
specified == you can only get this component via a selector.)
Fire away.
/LS
> -----Original Message-----
> From: Berin Loritsch [mailto:bloritsch@apache.org]
> Sent: den 17 juni 2002 18:12
> To: 'Avalon Developers List'
> Subject: [A5] CM Use Cases from real requirements
>
>
> What we need to address is the use cases from several current
> use cases. We *have* to address what the best way to solve
> each use case:
>
> This is probably the majority of cases (70%?). A
> component looks up
> another component by interface. It doesn't care about
> implementation
> issues, but it must exist for the component implementation to work.
> The current (A4) CM interface accomplishes this without problem.
>
> This is less common, but definitely appropriate. A component tests
> for the existence of an optional component--which it will use if it
> exists. If the component does not exist, it is not
> exceptional. This
> is in contrast with use case 1 where the missing component *is*
> exceptional. The current (A4) CM interface accomplishes
> this without
> problem because of the containsCOmpoennt() method.
>
:
> It is easiest to lookup components when you only have one way to
> access them. It reduces the complexity of maintaining your system.
> If the component being used is a CORBA component, or an EJB bean,
> the component should still be able to be resolved. The (A4) SM
> interface accomplishes this without problem because it returns
> Object instead of Component.
>
:
> The Container is responsible for this logic. Currently, Phoenix
> uses meta-information and a mapping file to manage the Component/
> role mapping. However this can be difficult to understand. The
> maintainer of a project that someone inherits has a lot of homework
> before they can understand how to map roles and components when
> there are multiple instances and the returned value changes based
> on the context of the calling component. We need a better way to
> explain this--because while it is powerful, it is too confusing
> for newbies.
>
:
> Nothing really handles this well. It is hacked together by the
> component selector/service selector in A4. The problem is best
> illustrated by a transformer. A document or transaction can be
> processed by several different transformers at runtime before
> the request is committed. Two examples include the Cocoon use
> case, and my data transformation server. The data transformation
> server passes a transaction object which multiple transformers
> may be applied to it before it is serialized to the persistence
> layer. Cocoon does the same with SAX events. This is what the
> proposed lookup(role,hint) hopes to solve.
>
> We need to account for every one of these use cases in a
> straight- forward way. The design constraints we should work
> within should
> be:
>
>
> I think this will provide the proper conceptual framework to
> design the nextgen ComponentLocator.
>
>
> "They that give up essential liberty to obtain a little
> temporary safety deserve neither liberty nor safety."
> - Benjamin Franklin
>
>
> --
> To unsubscribe, e-mail:
> <mailto:avalon-dev-> unsubscribe@jakarta.apache.org>
> For
> additional commands,
> e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>