You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Leo Simons <le...@apache.org> on 2002/08/19 11:51:44 UTC

a view of the Avalon Container

All (Steve, Pete's, Marcus, Berin, Paul, Nicola, Leo),

recent discussion on extending the lifecycle (or the need to do so) let
me to review the decisions that led to the lifecycle being defined in
the way it is now.
The main point of debate is not really the way to define it (using
well-known interfaces, coupled to contracts, implemented by components,
with metadata inside XML config files, as we have before), but the way
to support it inside a Container.

The definition of the Container
-------------------------------
During development of Avalon Framework 4, the concept of the container
was not formalized. In fact, framework sources have little to no mention
of a "container", and the same is true for the framework docs.

It has been recognized by all that the concept of the container is vital
for proper SoC in COP. We have found that early attempts at writing
these (ECM, Cocoon) muddied their design by mixing composition and
container concerns.

Until recently, the only reference for an architecturally clean
implementation of a framework-supporting container was Phoenix. Mainly
because of popularity growth of avalon in servlet environments, efforts
are now underway (merlin, fortress, plexus) to write a clean
framework-supporting container optimized for embedded use. An effort
targetting run-once (as opposed to server) usage (myrmidon) is also
showing promise.

Work on defining the container is underway. The current informative
definition reads:

" The Container is the entity that manages your Components. It handles
things like loading of configuration files, resolution of dependencies,
component management, component isolation, and lifecycle support.

The Container is not formalized in the form of an interface or contract
within Avalon Framework, though it might be at some point in the future.
The informal contract for the container is that it has the ability to
host any fully avalon-framework compliant component. Most current
containers place additional requirments on the component. "

The parts of a Container
------------------------
"Combine those new containers with the many iterations and designs
phoenix has seen in the past and extract the common parts, and you will
have a framework-level container definition." That's the thought that
led to the creation of something dubbed "ContainerKit", and the offspin
projects.

The parts that can usually be identified in a well-written container
are:
o the Embeddor/bootstrapper
  *************************
  This will likely remain a completely container-specific part as one
  of the main reasons for having different containers is having
  different problem domains with different bootstrapping needs.

o the Kernel
  **********
  The Kernel will remain mostly container-specific as this is the
  defining part of the container.

o the Component MetaData/MetaInfo/Type/Profile
  ********************************************
  It would be advantagious to develop a common meta model for components
  that is sharable at the object instance level (at least) across
  containers, as this is a requirment for complete component
  portability.

o the ComponentManager/ServiceManager implementation
  **************************************************
  This is not an area of much concern as framework implementation
  details are already transparant to clients, and this part of the
  Container already has a definition inside the framework.

Common Container Extensions
---------------------------
In complex setups where the container provides many features, the Kernel
will often become more and more elaborate; the best option in the end is
usually to adopt a micro kernel architecture, like Phoenix has. Many of
the most powerful kernels (like, for example, linux) allow pluggable
modules to be inserted into the Kernel for added or modified behaviour.

Work is now in progress to define a set of common interfaces that would
allow reuse of modules across micro-kernel-based containers. Since the
avalon framework is centered around the lifecycle, modularization of the
container is centered around lifecycle modularization.

As it has been recognized that support for the core lifecycle interfaces
(ie the interfaces in framework v4) is vital to all kernels, this is not
considered part of the discussion. A LifecycleHelper has been available
for a while so containers can delegate core lifecycle support.

Thus the remaining issue is lifecycle extension. A lifecycle extension
module would need to specify its relationship to the core lifecyle. It
seems wise to follow the same pattern used with the actual lifecycle:
use well-known interfaces, coupled to contracts, implemented by the
extension modules, with any metadata in XML configuration files.

When these interfaces have been defined, a common helper object
(following the same line of thought that created the LifecycleHelper)
can be created to support them easily inside a container.

It has been suggested that it would be advantagious to move these module
extension interfaces to the framework (as well as eventually the
LifecycleExtensionHelper) to guarantee adoption across containers that
provide lifecycle extension support.

Common Component MetaData
-------------------------
Work is also underway to define a common model for component metadata.
It has been recognized that the lowest level of component model support
is at the class level, and work is underway to define the common
interfaces and support classes that will make up this model.

It has further been recognized that additional common ground in the form
of shared XML DTD definitions (and locations wrt the component
classfiles) would allow another level of reuse. There is strong
disagreement on the DTDs though.

I'm missing some pieces
-----------------------
You will notice lack of implementation discussion. This is on purpose. I
have stated before that I feel the current arguments are focussed a lot
on implementation details where the underlying concept or preferred
architecture has not been separated out and agreed upon. Yet the
arguments for or against a particular implementation reference concepts
and architecture decisions.

Could someone please fill me in where this little analysis goes awry?

cheers,

Leo Simons


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: a view of the Avalon Container

Posted by Stephen McConnell <mc...@apache.org>.

Leo Simons wrote:

>All (Steve, Pete's, Marcus, Berin, Paul, Nicola, Leo),
>
>recent discussion on extending the lifecycle (or the need to do so) let
>me to review the decisions that led to the lifecycle being defined in
>the way it is now.
>The main point of debate is not really the way to define it (using
>well-known interfaces, coupled to contracts, implemented by components,
>with metadata inside XML config files, as we have before), but the way
>to support it inside a Container.
>
>The definition of the Container
>-------------------------------
>During development of Avalon Framework 4, the concept of the container
>was not formalized. In fact, framework sources have little to no mention
>of a "container", and the same is true for the framework docs.
>
>It has been recognized by all that the concept of the container is vital
>for proper SoC in COP. We have found that early attempts at writing
>these (ECM, Cocoon) muddied their design by mixing composition and
>container concerns.
>
>Until recently, the only reference for an architecturally clean
>implementation of a framework-supporting container was Phoenix. Mainly
>because of popularity growth of avalon in servlet environments, efforts
>are now underway (merlin, fortress, plexus) to write a clean
>framework-supporting container optimized for embedded use. An effort
>targetting run-once (as opposed to server) usage (myrmidon) is also
>showing promise.
>
>Work on defining the container is underway. The current informative
>definition reads:
>
>" The Container is the entity that manages your Components. It handles
>things like loading of configuration files, resolution of dependencies,
>component management, component isolation, and lifecycle support.
>
>The Container is not formalized in the form of an interface or contract
>within Avalon Framework, though it might be at some point in the future.
>The informal contract for the container is that it has the ability to
>host any fully avalon-framework compliant component. Most current
>containers place additional requirments on the component. "
>
>The parts of a Container
>------------------------
>"Combine those new containers with the many iterations and designs
>phoenix has seen in the past and extract the common parts, and you will
>have a framework-level container definition." That's the thought that
>led to the creation of something dubbed "ContainerKit", and the offspin
>projects.
>
>The parts that can usually be identified in a well-written container
>are:
>o the Embeddor/bootstrapper
>  *************************
>  This will likely remain a completely container-specific part as one
>  of the main reasons for having different containers is having
>  different problem domains with different bootstrapping needs.
>
>o the Kernel
>  **********
>  The Kernel will remain mostly container-specific as this is the
>  defining part of the container.
>
>o the Component MetaData/MetaInfo/Type/Profile
>  ********************************************
>  It would be advantagious to develop a common meta model for components
>  that is sharable at the object instance level (at least) across
>  containers, as this is a requirment for complete component
>  portability.
>
>o the ComponentManager/ServiceManager implementation
>  **************************************************
>  This is not an area of much concern as framework implementation
>  details are already transparant to clients, and this part of the
>  Container already has a definition inside the framework.
>
>Common Container Extensions
>---------------------------
>In complex setups where the container provides many features, the Kernel
>will often become more and more elaborate; 
>

I would replace the word "will" with "may". In the case of Phoeix yes - 
it has not alternative due to its linear component maangemnt 
architectue.  In the case of a container based on the Avalon Meta Model 
- such as Merlin, the container does not need to grow in complexity due 
to the inclusion of an extension framework and the benefits derived from 
a hierachical container management approach.

>the best option in the end is
>usually to adopt a micro kernel architecture, like Phoenix has. Many of
>the most powerful kernels (like, for example, linux) allow pluggable
>modules to be inserted into the Kernel for added or modified behaviour.
>
>Work is now in progress to define a set of common interfaces that would
>allow reuse of modules across micro-kernel-based containers. Since the
>avalon framework is centered around the lifecycle, modularization of the
>container is centered around lifecycle modularization.
>
>As it has been recognized that support for the core lifecycle interfaces
>(ie the interfaces in framework v4) is vital to all kernels, this is not
>considered part of the discussion. A LifecycleHelper has been available
>for a while so containers can delegate core lifecycle support.
>
>Thus the remaining issue is lifecycle extension. A lifecycle extension
>module would need to specify its relationship to the core lifecyle. It
>seems wise to follow the same pattern used with the actual lifecycle:
>use well-known interfaces, coupled to contracts, implemented by the
>extension modules, with any metadata in XML configuration files.
>

This is a very powerful approach.   When building a good container, the 
author is constantly dealing with the struggle between bootrap services 
such as logging and lifestyle management, as opposed to pluggable 
extensions components that expand the container's functional capability.

>
>When these interfaces have been defined, a common helper object
>(following the same line of thought that created the LifecycleHelper)
>can be created to support them easily inside a container.
>
>It has been suggested that it would be advantagious to move these module
>extension interfaces to the framework (as well as eventually the
>LifecycleExtensionHelper) to guarantee adoption across containers that
>provide lifecycle extension support.
>
>Common Component MetaData
>-------------------------
>Work is also underway to define a common model for component metadata.
>It has been recognized that the lowest level of component model support
>is at the class level, and work is underway to define the common
>interfaces and support classes that will make up this model.
>
>It has further been recognized that additional common ground in the form
>of shared XML DTD definitions (and locations wrt the component
>classfiles) would allow another level of reuse. There is strong
>disagreement on the DTDs though.
>
>I'm missing some pieces
>-----------------------
>You will notice lack of implementation discussion. This is on purpose. I
>have stated before that I feel the current arguments are focussed a lot
>on implementation details where the underlying concept or preferred
>architecture has not been separated out and agreed upon. Yet the
>arguments for or against a particular implementation reference concepts
>and architecture decisions.
>

This is a difficult point.

If we take somethig lie Phoenix - its an implementation that I consider 
to be wellin advance of Merlin in terms of its role as an app-server. On 
the other handl - Phonix management of extension and evolution is 
primative relative to Merlin.  This is not critisism of Phoenix or 
Merlin - its just reality - Merlin took the best of Phoienix and created 
a next generation.  There are implementation issues that Phoenix must 
deal with.  These einclude the extension requirements pushed by the 
EC/Cocoon community (and others).  Thee are also implemetation iosue 
that Merlin must deal with - for example ..  support for management 
access points. Total interoperability today is a matter of adation. 
 Merlin adapts for the potential inclusion of Phoenix based compoents. 
 The same it possible for Phoinix (although the Phoenix comunity hve 
chosen not to engage in the process).

 In practice we should be be dealing with three level of interoperability:

1.  DTD componet type defintion

    So at least a container can read in a defintion of a compoent and 
know if it understands the defintion

2. Componet type validation

    So a container container can manafe or reject a component type based 
on the information it understands

3. Component deployment

    WIthin a context that a container knows that it can satisfactory 
resolve the complete component requiements

>Could someone please fill me in where this little analysis goes awry?
>

The analysis is good.

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: a view of the Avalon Container

Posted by Stephen McConnell <mc...@apache.org>.

Paul Hammant wrote:

> Stephen,
>
>>>  + If the handler requires another component, has a context and surely
>>>    will need a configuration, what is the difference between it and
>>>    a component?
>>
>>
>> None.
>>
>> That's one of the fundimentatal difference between Merlin and 
>> Phoenix. Merlin is built using component oriented priocipals - 
>> Phoenix is a componet management system built using object oriented 
>> principals.  The difference is really significant.
>
>
> I'm not sure that is fair, the Phoenix impl is laced together in XML 
> allowing different components. 


The difference is that the component your referring to are restricted in 
terms of the lifecycle management.  For example, they cannot have 
depedencies. In contrast Merlin provides the container hierachy and the 
extension mechanism that both enable full unrestricted components to act 
as environment extensions.  For example, if you need a container 
providing "special-support" beyond normal component service dependecies, 
you can apply several different approach:

  * declare a container with depedencies (e.g. a container with a 
depedency on a transaction server)
  * create a container containing two sub-container - one for regual 
components and the other for internal services - you parent container 
can than make internal service available to the second container
   * add facilities via the extension mechanisms

In all cases, we are dealing with first-class components without any 
restrictions.

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: a view of the Avalon Container

Posted by Paul Hammant <Pa...@yahoo.com>.
Stephen,

>>  + If the handler requires another component, has a context and surely
>>    will need a configuration, what is the difference between it and
>>    a component?
>
> None.
>
> That's one of the fundimentatal difference between Merlin and Phoenix. 
> Merlin is built using component oriented priocipals - Phoenix is a 
> componet management system built using object oriented principals.  
> The difference is really significant.

I'm not sure that is fair, the Phoenix impl is laced together in XML 
allowing different components.

- Paul


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: a view of the Avalon Container

Posted by Stephen McConnell <mc...@apache.org>.

Leo Sutic wrote:

>>From: Leo Simons [mailto:leosimons@apache.org] 
>>
>>Could someone please fill me in where this little analysis goes awry?
>>    
>>
>
>Nowhere, really, if you can pull it off.
>
>But I agree with Peter Donald's arguments against lifecycle extensions. 
>Nice in theory and all, but how are you actually going to *do* it?
>
>I have taken a look at Merlin (these classes:
>http://cvs.apache.org/viewcvs.cgi/jakarta-avalon-excalibur/assembly/src/
>java/org/apache/excalibur/container/lifecycle/ )
>and as far as I can see, the pluggable pipeline stages (or phases, or 
>whatever), are limited to act on (1) the component/object and (2) the 
>Context.
>
>So... not only will the component have a type specifier that explains 
>what context entries it requires and what special lifecycle handlers 
>it requires - those handlers will also have a context requirement.
>  
>

Correct.
(if the extension handler actually needs any context information)

>So if you have a SpiffyLifeCycleStage that makes components all spiffy 
>as they come through it, how is that SpiffyLifeCycleStage going to do 
>it without support from the container to put a Spifficator (the means 
>to make a component spiffy) in the context?
>  
>

The container could do this using approach taken in Merlin.
Merlin provides complete suppoort for component profiles in which as 
assemble can include context directives.  This is the key to Merlin's 
resolution to issues with Phoeix such as the prolific use of container 
specific interfaces suchb as BlockContext.  Merlin enables the assemble 
or the develper to declare the context values.  In addition, extesnions 
are componets and can aquire services that need via classic dependecies.

>If you have a PersistentLifeCycleStage, how are you going to obtain 
>the persistence mechanism if the container doesn't give it to you via
>the context?
>  
>

1. via a context directive provided by a profile
2. via a service depedency

>The problem with populating the context with any non-constant entries 
>(such as a Spifficator) has already been discussed and found to have 
>no solution short of mind-reading the programmer and sprouting new code 
>on startup/linking.
>  
>

Incorrect.

Please to a checklut of Merlin and run the demonstrations.  You will 
find exampes of components that are suppllied with context valiues 
beased on profile based directives. You will also find a coupe of 
examples of extensions (yes - real components that are handled as fist 
class componets my Merlin - don't be misslead by the lack of 
component-oriented suport in other Avalon container - Merlin has sorted 
this out).

>If I am missing something, and there are solutions to the problems I 
>outlined above, please fill me in.
>

Merlin 2.0
Check it out.
Problems solved.
Solutions are working, demonstration available.
Tested and validated across several projects.
A collaborative project.

>
>At the moment, the lifecycle extensions appear to be shiny new features
>that while nice in theory are useless in practice. I'm afraid that any
>container trying to implement them in a useful way will (1) never be
>completed and (2) implode under its own weight. It's just too much "do 
>everything", too much genericism, in it.
>  
>

Ouch - !!
Take a look at Merlin - the code to implement this is rather small.
Yes - in the Phoenix linear model its a PITA - but Phoex isn't the 
reference.The big kicker is that Merlin handles extensions as real 
compoents - that changes everything - you end up with massive reuse - 
the extension elememnts become minor in the overall scheme.


>Miscellaneous issues:
>
>  + Will the lifecycle handler need a component/service manager?
>    How will a DB-persistence handler work? Will it use the Excalibur 
>    Datasource component? How will it access it?
>  
>

In Merlin an extension is a componet.  It declares it depedencies just 
as any othr componet declares dependecies.
I.e. No problem.

>  + If the handler requires another component, has a context and surely
>    will need a configuration, what is the difference between it and
>    a component?
>

None.

That's one of the fundimentatal difference between Merlin and Phoenix. 
 Merlin is built using component oriented priocipals - Phoenix is a 
componet management system built using object oriented principals.  The 
difference is really significant.

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: a view of the Avalon Container

Posted by Leo Sutic <le...@inspireinfrastructure.com>.
> From: Leo Simons [mailto:leosimons@apache.org] 
>
> Could someone please fill me in where this little analysis goes awry?

Nowhere, really, if you can pull it off.

But I agree with Peter Donald's arguments against lifecycle extensions. 
Nice in theory and all, but how are you actually going to *do* it?

I have taken a look at Merlin (these classes:
http://cvs.apache.org/viewcvs.cgi/jakarta-avalon-excalibur/assembly/src/
java/org/apache/excalibur/container/lifecycle/ )
and as far as I can see, the pluggable pipeline stages (or phases, or 
whatever), are limited to act on (1) the component/object and (2) the 
Context.

So... not only will the component have a type specifier that explains 
what context entries it requires and what special lifecycle handlers 
it requires - those handlers will also have a context requirement.

So if you have a SpiffyLifeCycleStage that makes components all spiffy 
as they come through it, how is that SpiffyLifeCycleStage going to do 
it without support from the container to put a Spifficator (the means 
to make a component spiffy) in the context?

If you have a PersistentLifeCycleStage, how are you going to obtain 
the persistence mechanism if the container doesn't give it to you via
the context?

The problem with populating the context with any non-constant entries 
(such as a Spifficator) has already been discussed and found to have 
no solution short of mind-reading the programmer and sprouting new code 
on startup/linking.

If I am missing something, and there are solutions to the problems I 
outlined above, please fill me in.

At the moment, the lifecycle extensions appear to be shiny new features
that while nice in theory are useless in practice. I'm afraid that any
container trying to implement them in a useful way will (1) never be
completed and (2) implode under its own weight. It's just too much "do 
everything", too much genericism, in it.

Miscellaneous issues:

  + Will the lifecycle handler need a component/service manager?
    How will a DB-persistence handler work? Will it use the Excalibur 
    Datasource component? How will it access it?

  + If the handler requires another component, has a context and surely
    will need a configuration, what is the difference between it and
    a component?

  + Go back to the final proposal for A5. Doesn't it solve everything
    by allowing/requiring you to specify handlers/factories for
components?

/LS


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>