Timo Rantalaiho wrote:
On Tue, 03 Mar 2009, Chris Hansen wrote:
The situation that I'm dealing with most commonly is where I'm dealing
with simple, DTO-like POJOS with no-arg constructors and
getters/setters (why they are not serializable in the first place is
beyond me). It just seems like it would be possible, in this simple
case, to create a proxy for each object in the object graph which is
not serializable until you get down to the actual data (i.e.
primitives, Strings, etc.) which is serializable. The proxies would
have to keep track of whatever information they need to de-serialize
themselves (e.g. class name and constructor). It seems like this has
not been implemented, but do you think it is possible to do so?
That sounds cumbersome too :)
If the objects are in fact serializable, why can't you make
them Serializable?
As I am learning AspectJ lately I try to solve every problem with it :)
it turns out you could weave DTOs you have no control over to implement
Serializable interface:
public aspect SerializerImplementer {
declare parents: ProductDTO implements Serializable;
declare parents: ContractorDTO implements Serializable;
declare parents: InvoiceDTO implements Serializable;
}
You can do it once and have no problem with it ever again...
--
Leszek Gawron
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]