You could make a PersonRPC class that contains only the fields you want to
pass to the client...

You could also make PersonRPC the parent class of your Person class.


On Mon, Feb 2, 2009 at 2:00 AM, max.bruchmann <[email protected]>wrote:

>   Hi,
> I read a lot of time that flex/blazeds/hibernate is a cool combo. But
> I there is one thing that troubles me.
> So let's asume I have a Person class
>
> public class Person {
>
> public var name:String;
> public var id;
>
> }
> It's no problem to send objects from this class between client and server.
> But let's assume the Person class has furthermore a list of groups he
> belongs to.
>
> public class Person {
>
> public var name:String
> public var id;
> public var groups:ArrayCollection;
>
> }
> public class Group {
>
> public var name:String;
> public var id;
>
> }
>
> 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
[email protected],

Reply via email to