On Sunday 02 November 2003 00:57, hammett wrote: > Do you want some messages like "store" and "load" managed by some external > entity (component)?
why not, I dont have strong requirement ;) > Then that can be done by a additional extension, but I don't know why this > should be done this way. Niclas see a persistence engine as a different > component and I see components that can handle their own persistence > transparently. Yes that could be nice: transparently persistence. > I strongly advise you to support persistence that can be plugged in and > off, so please check http://www.prevayler.org/ > > Few months ago I worked in a simple business model (using avalon) whose > business objects implemented IBusinessObject that exposed save/remove. > These methods ask for their PersistenceManager (as Niclas commented). So, > for Unit testing we could use prevayler, but in our real solution we used a > common rdbms. > > [AvalonService( typeof(IEntity) )] > [AvalonComponent( "entity", Lifestyle.Transient )] > [AvalonDependency( typeof(IEntityPersistence), "Persistence", > Optional.False )] > public class Entity : AbstractBusinessObject, IEntity, ILookupEnabled > { > <....> > /// <summary> > /// Saves this object against the storage. > /// <seealso cref="Keldor.Common.Entity.Persistence.IEntityPersistence"/> > /// </summary> > public override void Save() > { > IEntityPersistence persistence = (IEntityPersistence) > _manager["Persistence"]; > persistence.Save(this); > } > > /// <summary> > /// Removes this object from the storage. > /// <seealso cref="Keldor.Common.Entity.Persistence.IEntityPersistence"/> > /// </summary> > public override void Remove() > { > IEntityPersistence persistence = (IEntityPersistence) > _manager["Persistence"]; > persistence.Remove(this); > } > } I see, you mean the component save/load it state via load/save methods that could also occurse during lifecycle. Nice. But how do you get/find a component (using a sort of finder, for exemple)? Something like, lookup & load the component having name 'joe'". --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]