Alexis Agahi wrote:

... I'm trying to see beyond this, to maybe get some

magical model, maybe inside component manager or Merlin Extension.



I think the elegant approach is for a container to provide support for identity
at the meta-info and meta-data layers, combined with a common set of patterns
concerning home interfaces.


1. meta-info tag declaring type as identifiable + storage value type
2. where (1) implies a storage value type home
3. where (2) implies a storage value type home implementation
4. where (1) implies a standard meta-data key description
5. from which automated state value supply is possible

E.g.

 <type>
    <info>
      <name>demo</name>
      <lifestyle>singleton</lifestyle>
      <identity type="MyStateValueType"/>
    </info>
 </type>

Mapping from MyStateValueType (an interface) to a home is not the same as service to provider resolution. Instead, what you want to locate is a component that implements a home interface for the MyStateValueType - e.g. MyStateValueTypeHome is the home interface and MyStateValueTypeHomeProvider is the component implementation that provides creation, retrival and destruction of instance of MyStateValueType.

At the meta-data level would would need something like:

 <component class="MyDemoComponent" name="whatever">
   <identity>
     <key>12345</key>
   </identity>
 </component>

The container on creation of an identifiable component resolves the home factory (an implicit lifecycle dependency) and if the meta-data declares a key, then a persistent value is retrieved and supplied to the component via a context entry. If no identity is supplied, a new state value is created and supplied.

Any thoughts?

Cheers, Steve.

--

Stephen J. McConnell
mailto:[EMAIL PROTECTED]




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



Reply via email to