avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen McConnell <mcconn...@apache.org>
Subject Re: [RT] Component Persistence
Date Mon, 03 Nov 2003 01:37:28 GMT


Alexis Agahi wrote:

>On Sunday 02 November 2003 14:05, Stephen McConnell wrote:
>
><snip/>
>
>  
>
>>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?
>>    
>>
>
>
>I'm not sure to understand clearly your approach.
>Tell me if I'm wrong
>
>You suggest 3 parts
>1/ compenent: implementing home interface (2)
>2/ home: interface that define persisted data
>3/ provider: impl that provides custom finder for home interface of the 
>component (1)
>

Close.

>
>but I dont get clearly identity/home purpose. 
>

I'll explain below.

>Should home define method that 
>will be used by provider to establish persitence? (if yes, then this sounds 
>nice ,))
>

Here is a move detailed breakdown of the terms I'm using:

  * identifiable component - an instance of a identifiable component type
  * identifiable component type - a type that includes an <indentifiable>
       elements declaring a home interface
  * home - a component implementing a home interface
  * home interface - defintion of storage value creation, query
       and destruction operations
  * home component - a component that implements the home interface
       and handles storage value creation query and destruction
       using some persistence solution

So for example, lets imagine we have something called a User and that
we maintain multiple users.  From this we would need:

Interfaces:

  * User - an service interface
  * UserStorage - an interface defining operation on a user storage
      value instance
  * UserHome - the home interface

Classes:

  * DefaultUser - an identifiable component
  * DefaultUserStorage - a class implementing UserStorage using a
      particular persistence solution
  * DefaultUserHome - implementation of the UserHome

A container on deploying a identifiable component would locate and
deploy a component implementing the UserHome service, get an instance of
UserStorage from the home and add this to the identifiable
components context.

Cheers, Steve.

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Mime
View raw message