[kforge-dev] Re: Delete = Hibernate or Purge for Domain Objects

John Bywater john.bywater at appropriatesoftwarefoundation.org
Mon Sep 19 13:28:52 UTC 2005

Rufus Pollock wrote:

> Previous discussion off-list has tended to the view that we should 
> hibernate most things (e.g. users, projects, services, memberships 
> etc) rather than purging them when a delete is requested from a user 
> interface
> We can do this several ways:
>   1. split delete into purge and hibernate
>   2. make delete = hibernate and add a purge command
>   3. have no purge, just hibernate
> It important to define these semantics so that plugins know what to do 
> on particular events. The obvious idea would be that hibernate would 
> leave all service instance date intact while purge would result in its 
> removal.
> My preference is for option 2 but eager to hear comments.

I agree: my preference is also for option 2, such that it is possible to 
undelete deleted domain objects. Purging would however be "unpurgable".

Perhaps we want to implement purging after we have implemented undelete?

> Since all of these changes would result in the addition of actions to 
> the Domain Model as perhaps the change of plugin interface we should 
> decide on this as soon as possible.

We are going in the right direction: we just need to add undelete() and 
purge() methods, and make sure delete() hibernates.

Regarding hibernation, I would like to use sqlobject.inheritable, but it 
doesn't seem to be distributed by Debian. However, as we are now 
generating the database mapper classes from domain object meta classes, 
it would perhaps be adequate automatically to add a 'state' field to 
each record. Anyway, the requirement is to have the SQLObject selectBy() 
method normally return non-hibernated objects from the RDBMS in one go, 
rather than some two step process. The base Mapper coerceKeywords() 
method is the place for this.



> Regards,
> Rufus

More information about the kforge-dev mailing list