commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Kuenzler <>
Subject Re: [Morphos] Status?
Date Tue, 16 Jul 2002 16:15:56 GMT
Nicola Ken Barozzi schrieb:


>  void morpher.morph(Object in, Object out);
> and also
>  Object morpher.morph(Object in);
> I really would like to see a single method for morphing, and it seems 
> that it could be done via a:
>  void morpher.morph(MorphInput in, MorphOutput out);
> Where MorphInput and MorphOutput contain references to the objects...
> but I still don't like it :-/

At least for the things *I'd* like to "morph", the interface from the 
original Morphos proposal would be handier than Transformer's signature. 
The MorphIntput and output wrappers you mention above might be worth a 
thought. What if  the use of these would be optional? So a 
Foobar2OutputStreamMorpher could spare the overhead of dealing with 
these wrappers, while a Foobar2StreamMorpher would still be possible 
thanks to MorphOutput.
If you define Morphers to be more "heavyweight" compared to Pattern's 
transfomers, I guess most of the time Morphers won't work on inmutable 
Output objects anyways. Therefore I would not mandate their use.

Plus, a FB2StringMorpher could easily be a FB2StringBufferMorpher. What 
else potential output objects would need to be wrapped?

 > Maybe, afterall, the best thing is just making Morpher a thing that is
 > different from Transformer, ie something that *changes* the output.
 > In this way we would have Transformer for immutable objects and Morpher
 > for mutable ones?
> Hey, is it this that you were telling me?
> I finally got it? ;-P

Me? I was just playing javac, complaining about an unknown method ;-)

Seriously: I don't know the rationale for the "input inmutable" 
restriction in Transformer. Probably the destinction is really the 
"light vs. heavy weight" argument mentioned before. Stephens post also 
pointed in that direction.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message