axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanjiva Weerawarana <>
Subject Re: [AXIS2] [Sandesha2] Saving the message context
Date Sat, 29 Jul 2006 13:03:03 GMT
Hi Bill,

> Having the objects persist their own state is far less error prone than
> having a third-party piece of code do the persistence.  For one, anytime
> someone changes or adds a piece of information that needs to be saved in
> order to correctly restore the state, they have to remember to modify
> the external code.  It's generally hard enough to remember to modify
> code embedded in the class itself, much less having to remember to
> modify a completely separate piece of code.


> Secondly, you require the objects that need to be saved to expose
> methods, to return the portions that you want to have serialized, that
> you may not have to expose otherwise.

I don't think that was done - that is, the MC did expose everything that
was interesting already. But +1 to the principle.

> In effect, the approach that you've chosen has abandoned encapsulation
> and created fragile dependencies -- this is bad design.

OK so there's another reason .. what Sandesha does is not Java
serialization. If we use Externalizable then yes we get control of what
to write but you still have to write to a Java object stream right? In
the case of Sandesha Chamikara has introduced a persistency abstraction
layer to support both in-memory and persistent operation. The persistent
stuff can be impl'ed with anything but so far we've only done a
Hibernate impl (which cannot be committed to Apache due to license
issues; so the code is currently on a WSO2 repo - Chamikara is putting
the code out). 

Can we do the same stuff using Externalizable? If so I agree that's a
better approach for maintaining encapsulation.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message