commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <>
Subject Re: [Morphos] Java data morphing package - second stab
Date Thu, 06 Jun 2002 19:45:51 GMT
>   * It uses two params and not a return value to make it usable with
>   * event based Objects (contenthandlers).
>   * Events in the Morpher are notified by registering a listener.
>   * [new] parameters are managed with beans get/set methods
>   *            *none* are mandatory
>   */
>  public interface Morpher {
>      void morph(Object input, Object output) throws MorphException.
> [Clarification]
> Why not
>   Object morph(Object input) throws MorphException, IOException;
> ?
> Because if the output object is a SAX handler, the morphing doesn't take
> place, and this is not evident.
> Any other pros-cons?

The problem with the two object input approach is that it precludes a simple
type convertor being written using this architecture. A type convertor
typically takes in an immutable object and returns an imutable object
(String/Integer etc.)

Object morph(Object input)   does allow a String to Integer convertor, but
is obviously a second interface, potentially providing confusion.

Given this, you may want to refine the definition of what can or can't be
morphed (ie. to exclude immutable outputs).


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

View raw message