I had the same problem and solved it by using a superclass that contains
only the subset of data the client really needs...

For example:

PersonRPC
{
   id
  name
}

Person extends PersonRPC
{
   lots of other data the flex client really do not need, but is usefull in
the backend...
}


if you do not like this you could drop the inheritance and do something
like:

PersonRPC
{
   id
   name

   PersonRPC(Person p)
   {
      this.id = p.id ;
      this.name = p.name
   }
}

and then serialize / return PersonRPC to the client...

On Mon, Feb 2, 2009 at 5:47 PM, mmormando <m...@mormando.com> wrote:

>   We are still dealing with this problem on a daily basis on my current
> project, and there still doesn't seem to be a good answer, at least as
> far as BlazeDS goes. The way that web frameworks deal with the issue
> is lazy loading, so that the data access to load the child objects
> doesn't happen until you actually access those objects, but because
> we're serializing the objects when we send them acrossed the wire in
> BlazeDS, the entire object graph gets realized, leading to some HUGE
> amounts of data possible, depending on how complex your data is. Now
> supposedly they have "fixed" this, meaning enabled lazy loading, in
> GraniteDS, and many are hoping for a similar solution coming out of
> the Spring/BlazeDS integration project. I say supposedly because I
> haven't personally tested it, we're 7 months into an 8 month project,
> not a good time to be thinking about changing out such a major part of
> our project!
> Good luck!
> Mike
>
> --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>,
> "max.bruchmann"
> > So now everytime we send a person object back to the blazeds/hibernate
> > backend all the groups he belongs to are getting serialized as well.
> > This means a lot of overhead gets send to backend when I only modify
> > some primitve data like the name.
> >
> > Even more problematic would be if in addition the group objects
> > themselves would have list of persons that belongs to them.
> >
> > I guess I could use the [Transient] Metatag to not send the collection
> > fields, but then I could not modify the groups in a person object
> easily.
> >
> > So if there is any best practice for these kind of problems, please
> > let me know.
> >
> > Thanks in advance
> > Max
> >
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
fotis.chatzini...@gmail.com,

Reply via email to