Title: RE: [Hibernate] Moving Hibernate objects with SOAP
Hi Jon,
 
One of the things that I currently do is use XDoclet to generate inline transforms for going back and forth from XML to entity.  You end up with hardcoded serializers, which are very fast, but I don't have enough experience with it yet to know what extended maintenance is going to be like.  It would theoretically be possible to generate a schema/dtd that goes with the serializers, and one maintenance process might rename the then-current serializers and schema pair to something new as the system grew (giving the ability to support backwards compatibility).  Some environments won't need all this though. 
 
Note that I am currently using it with XDoclet value objects (DTOs, if I understand the two correctly) from entity beans.  So what I have will need a bit of work to make it work with Hibernate POJOs, but not much and I plan on doing that work within the next few days.  As it works today, simply changing your XDoclet tags for your entities rewrites the serializers automagically.  The same thing will happen with the POJOs when I am done.
 
I can forward or post what I have when I have it for anyone that is interested.  I've thought about integrating this into the mainline XDoclet tree, but wanted to get some experience with it first.  If anyone has thoughts about such an integration (pro/con), please share.
 
best,
 
-b
-----Original Message-----
From: Jon Lipsky [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 4:59 PM
To: 'Josh Rehman'; '[EMAIL PROTECTED]'
Subject: RE: [Hibernate] Moving Hibernate objects with SOAP

Hi Josh,

I needed to send my objects over SOAP as well (though using GLUE, not Axis).  What I ended up doing was write a custom serializer/deserializer that would write my hibernate data objects to and from XML.  When I want to send the object over the wire, it is serialzed to XML, and then on the client side it deserialzed back into it's object state.  Doing it this way means that I have fine control over how much of the data hibernate lazily loads, meaning it only loads what I want it to send over the wire.

The methods that are exposed with SOAP just send byte arrays around, and there is an API that wraps those methods that to handle the deserialization/serialization.  Doing it this way allowed me to avoid having to add special "DTO" objects into my model.

Regards,
Jon...

-----Original Message-----
From: Josh Rehman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 07, 2003 2:46 AM
To: [EMAIL PROTECTED]
Subject: [Hibernate] Moving Hibernate objects with SOAP


Hello all,

I'd like to move Hibernate generated objects (generated with hbm2java,
of course) across the wire with SOAP.

There are two problems:

First, Hibernate generates collection accessors. This is great, but
these are, by necessity, untyped. The Axis serializer cannot handle this.

Second, it often comes to pass that we are only interested in a subset
of the object. In particular, we often do NOT want to move an entire
collection accross the wire. Unfortunately, the serializer will call all
accesors on the hibernate object, and CGLIB will, of course, do it's job
and get everything known about that object.

We have so far tried to solve these problems by writing an additional
code generator that creates so-called "Data Transfer Objects" (Fowler's
term, also abreviated DTO) that have a) typed array accessors, and b)
the ability to specify a subset of interesting properties. We aren't
quite done with this effort, but it's so far working out well. The DTOs
are generated by delegating work to an underlying hibernate class.

Has anyone faced and solved, these probelms? If so, I'd like to hear
about it. In particular, I was hoping that there is something obvious
that I may have missed.

With kind regards,
Josh Rehman



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

_______________________________________________
hibernate-devel mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to