Hi,

On Tue, 23 Jul 2002 23:15, Aleksei Valikov wrote:
> We've desided to move our system to Avalon and I would like to ask for some
> recommendations regarding serializable components.

The Avalon/Framework part does not do anything besides specify basic lifecycle 
management. Things like persistence have not really been specified in any 
formal manner and the main reason for this is that every component system 
(EJB, CORBA, beans + peers) seem to implement it slightly differently.

I would recomend that you define your own persistence interface. Perhaps 
something like

public interface Persistent
{
  void load( PersistentData data );
  void save( PersistentData data );
}

Then your container would be responsible for calling load/save at the correct 
time. For instance if your container was shutdown it would first call save() 
before stop()/dispose()

So the usual lifecycle for component would be 

Startup:
enableLogging()
compose()
configure()
initialize()
start()
load()

Runtime:
load() (could be called multiple times)
save() (could be called multiple times - following a load)

Shutdown:
save() (could be called 0 or more times)
stop()
dispose()


This is similar to how "enterprise" frameworks operate (like Entity beans and 
friends) except they allow you to load multiple times. ie Consider the case 
of a Book component that had data intances "The art of war" and "Principa 
Mathematica". 

Now consider the component A of type Book (that implements Persistent). A 
could be "The art of war" when load() is first called and "Principa 
Mathematica" the second time load() is called. Note that LogEnabled is only 
called once. AT least this is the architecture that big systems use. It may 
be overkill for what you want or it may not.

However Avalon does not really say anything about it at this stage though I 
believe that the Cocoon people are formalizing a container (fortress) that 
will do that for them.


-- 
Cheers,

Peter Donald
Doubt is not a pleasant condition, but certainty is absurd.
                -- Voltaire 


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

Reply via email to