Andy,

-----Ursprüngliche Nachricht-----
Von: Andy Buckley [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 11. Dezember 2006 15:24
An: [email protected]
Betreff: Re: AW: [castor-user] Set Marshaller sink after construction?


Werner Guttmann wrote:
> Other than opennig a Jira issue at http://jira.codehaus.org/browse/CASTOR,
> and ask us to provide those methods, no ... ;-). As I have added the one for
> Writer myself a few eeks ago, it should not be too hard .... but as always,
> patches would be welcome ... ;-).

Thinking a bit more about this, it's not obvious to me how the various set
methods should be implemented. A marshaller will only have one mapping, for
instance, but what should we expect mymarshaller.marshall(myobj) to do if both
a Writer and a Node have been set?
Werner --> One could for, for example, derive rules for this, by e.g. assuming 
that any call to such a setter would replace the existing sink, etc,.


To me, it seems the most natural solution would be to have instance methods
which mirror the current static methods. In other words, the sink isn't a
property of the marshaller, it's just provided when the
mymarshaller.marshal(obj, sink) method is called.
Werner --> Yes, I agree. But before doing this, let's have a look whether it is 
possible to use the existing static methods on an Marshaller instance (in 
theory).

What do you think? That seems natural to me (and is why I tried calling the
static methods by accident in the first place), but I'm not sure without trying
whether the static methods will prevent instance methods with the same
signature from being defined. If this seems a sane approach, and there's no
technical restriction, then I'll happily provide you with a patch :)

> PS Re: static marshal() methods .. I think they have been added for
> convenience reasons ... and somehow I wish that didn't happen myself .. ;-).

Yes, I can understand that! And so hard to remove once they're there...
Werner --> And even harder so when the code generatd by the XM code generator 
makes use of those methods, too .. :-(.

Andy

-- 
Andy Buckley: CEDAR @ IPPP, Durham
Work: www.cedar.ac.uk
www.insectnation.org

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to