I cannot make them serializable I don't have control over them. But even if I did I couldn't because the valueobject has a reference to an entity which cannot be serializable. The project also uses db4o which would make it much harder to use a serialized version. Is dtos the best/only way? It would be a very awkward design because I have to both deal with subclasses of valueobject and converting the objects back when calling the service layer
------Original Message------ From: James Carman To: [email protected] ReplyTo: [email protected] Subject: Re: another serialization question Sent: Nov 10, 2009 11:39 PM Are you designing these value objects from scratch? Do you have control over them? Then, why are you averse to making them serializable? If you have a valid reason to not make them serializable, then why not go with the DTO pattern and just figure out a way to copy the attributes back and forth between your value objects and your DTOs? On Tue, Nov 10, 2009 at 10:17 PM, Sam Barrow <[email protected]> wrote: > But some the ValueObject classes contain a reference to an entity. > Keep in mind I mean ValueObject in the context of domain driven design, > not a DTO / data transfer object. > > On Tue, 2009-11-10 at 22:12 -0500, James Carman wrote: >> ValueObjects (if you're following the design pattern) should be serializable. >> >> On Tue, Nov 10, 2009 at 10:03 PM, Sam Barrow <[email protected]> wrote: >> > >> > One more question about serializing objects. >> > I have a page in the application that I'm working on that calls an >> > application service which returns a collection of objects of a type I'll >> > call ValueObject (not serializable). ValueObject has many subclasses >> > (which are of no concern to my wicket ui, which only deals with the >> > ValueObject interface). >> > >> > So i have a page which calls the service and now has a collection of >> > ValueObjects. What is the best way to pass this object to another page? >> > Keep in mind it is not serializable and has no identity i can look it up >> > by >> > >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: [email protected] >> > For additional commands, e-mail: [email protected] >> > >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
