That might be a problem if you have a big object
graph.  You get a big penalty even if you only modify
a small peice of the object graph.

You could do a shallow copy by getting a snapshot of
the fields of the object.  Then wrap up the children
objects with "Versioned.makeVersioned(child)" when
they are accessed.  The cool thing is that you would
not have any serialization at all.  I know that there
has to be some down-sides to this approach, help me
figure them out.

Regards,
Hiram


--- Bill Burke <[EMAIL PROTECTED]> wrote:
> Yes, its a deep copy which is why I require
> Serializable.
> 
> new MarshalledObject(obj).get();  
> 
> Maybe there is a better way to make copies?
> 
> > -----Original Message-----
> > From:
> [EMAIL PROTECTED]
> >
>
[mailto:[EMAIL PROTECTED]
> Behalf Of Hiram
> > Chirino
> > Sent: Thursday, March 27, 2003 10:15 AM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [JBoss-dev] AOP versioned ACID
> objects 1st iteration
> > 
> > 
> > 
> > Bill,
> > 
> > If you use versioning on a POJO that is a the top
> of
> > an object graph, will the children objects also be
> > versions when they are modified???
> > 
> > I assume No.  But I think it would make sense for
> your
> > Versioning interceptor to wrap up children objets
> with
> > the versioning proxy also when they are accessed. 
> > That way if you do a:
> > 
> > pojo = (POJO)Versioned.makeVersioned(pojo);
> > pojo.getAccount().getBalance().add(10.00);
> > 
> > The modification of the Balance object will be
> > versioned too.  Does that make sense to you??  Do
> you
> > do this now??
> > 
> > Regards,
> > Hiram
> > 
> > --- Bill Burke <[EMAIL PROTECTED]> wrote:
> > > 
> > > 
> > > > -----Original Message-----
> > > > From:
> > > [EMAIL PROTECTED]
> > > >
> > >
> >
>
[mailto:[EMAIL PROTECTED]
> > > Behalf Of
> > > > Karthik
> > > > Sent: Thursday, March 27, 2003 1:25 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: RE: [JBoss-dev] AOP versioned ACID
> > > objects 1st iteration
> > > >
> > > >
> > > > Hi bill,
> > > >    The versioning of POJO is very good. I have
> > > some issues here. If I
> > > > version a object, then I have to maintain all
> the
> > > state in the same POJO
> > > 
> > > How is this not the general case?  All
> application
> > > code accesses the POJO
> > > through the proxy.  I am going to write a
> > > constructor-pointcut that will
> > > always return a proxy instead of the real POJO
> on
> > > construction.
> > > 
> > > > which is not the general case and will bloat
> the
> > > code. The states are
> > > > maintained in the helper classes. Also
> defining
> > > each POJO as versioned is
> > > > meaningless. If new proxies are created for
> each
> > > transaction with the deep
> > > > copy of all the state or maintain a pool and
> > > synchronize the state after
> > > > update,  it will become real performance
> > > bottleneck.How do you tackle this
> > > > problem?
> > > 
> > > There is only one proxy, but you are correct. 
> For
> > > each transaction, a full
> > > snapshot is taken of the real object.  All
> access to
> > > the object is done
> > > through one proxy.
> > > 
> > > The performance hit is the full deep copy not
> the
> > > synchronization.
> > > Synchronization is only:
> > > 
> > > realObject = snapshot;
> > > 
> > > Remember, we're optimistically locking here. 
> > > (Although I'd like to
> > > optionally provide a transactional lock in the
> near
> > > future).
> > > 
> > > The alternative solution is much much more
> complex. 
> > > The biggest problem
> > > being, how do you determine when a POJO's state
> has
> > > changed?  For instance:
> > > 
> > > Pojo.someHashMapField.get().setValue(blah).  You
> see
> > > my point?
> > > 
> > > A full deep copy greatly simplifies the code. 
> > > Simplicity == robustness.
> > > Plus I'm not even sure versioned fields would be
> > > better performing.  Field
> > > interception is quite expensive and versioned
> fields
> > > would need field
> > > interception.
> > > 
> > > The code is under: 
> > >
> varia/src/main/org/jboss/aop/plugins/Version*.java
> > > testcase is under
> > >
> >
>
testsuite/src/main/org/jboss/test/aop/bean/Version*.java
> > > (take a look at the AOP DD under
> > >
> testsuite/src/resource/aop/META-INF/jboss-aop.xml
> > > too).
> > > 
> > > Bill
> > > 
> > > 
> > > 
> > > >    Correct me if I am missing something.
> > > >
> > > >    Where or when can get the code from the
> CVS?
> > > >
> > > > Thanks
> > > >
> > > > Karthi
> > > >
> > > > > -----Original Message-----
> > > > > From:
> > > [EMAIL PROTECTED]
> > > > >
> > >
> >
>
[mailto:[EMAIL PROTECTED]
> > > > > Behalf Of Bill
> > > > > Burke
> > > > > Sent: Thursday, March 27, 2003 10:43 AM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: RE: [JBoss-dev] AOP versioned ACID
> > > objects 1st iteration
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From:
> > > [EMAIL PROTECTED]
> > > > > >
> > >
> >
>
[mailto:[EMAIL PROTECTED]
> > > > > Behalf Of Jeff
> > > > > > Haynie
> > > > > > Sent: Wednesday, March 26, 2003 11:51 PM
> > > > > > To:
> [EMAIL PROTECTED]
> > > > > > Subject: RE: [JBoss-dev] AOP versioned
> ACID
> > > objects 1st iteration
> > > > > >
> > > > > >
> > > > > >
> > > > > > >JBoss Remoting is much more fabulous.  We
> > > need to get the
> > > > > word out on
> > > > > > it...
> > > > > >
> 
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com


-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to