[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object Creation in ozone



Falko Braeutigam wrote:

> On Sat, 12 Aug 2000, Tim Brown wrote:
> > I think you are suggesting the oodb would call the parameterless constructor
> > and then your app would call the other?  I do something similiar with my
> > construct() method.  What is needed is what Don suggested which is a method
> > ozone would call after the object exists, like init().
> >
> > I think such an init() method could be called by the object creation thread and
> > work fine.  At least I cannot think of a reason why not after having looked at
> > the ozone code for this.
>
> Using callback methods seems to be a good solution here. There is one already -
> OzoneCompatible.done() is called when the object is deleted - but it isn't a
> common design pattern of ozone yet. However, callback methods seems to meet our
> (Don's) needs perfectly. Right?
>
> So I propose to add two new methods to OzoneCompatible:
>         onCreate();  //called right after the object is created
>         onDelete();  //called right before the object deleted
>
> Things like preStore/postLoad would make sense only if we want an equivalent of
> EJB's bean (object) managed persistence in ozone.
>
> onCreate()/onDelete() are introduced by OzoneCompatible. They could be default
> (empty) implemented by OzoneObject so that one doesn't need to implement both
> method for all database object. But I'm not yet sure here. Keeping both methods
> abstract would force the programmer to implement them, which may help to keep
> the special requirement of the database object in mind. ?
>
> Falko
> --
> ______________________________________________________________________
> Falko Braeutigam                              mailto:falko@smb-tec.com
> SMB GmbH                                        http://www.smb-tec.com

I think they should be stubs, not abstract.  Not all database objects need this behaviour.  Just document it :)

--
Tim Brown
URL: http://www.incenter.org