Re: [morph-developer] RuntimeException wrapping
Brought to you by:
orangeherbert,
sgarlatm
|
From: Matt B. <gud...@ya...> - 2007-04-12 17:28:16
|
Hi, Matt--I am fine with this.
-Matt B
--- Matt Sgarlata
<Mat...@wh...> wrote:
> I have an initial implementation that allows
> RuntimeException wrapping
> to be turned off. I added to BaseTransformer:
>
> protected boolean isWrappingRuntimeExceptions()
> {
> return true;
> }
>
> As you can see, I opted to wrap RuntimeExceptions by
> default. As I've
> thought about this problem over the past few months,
> I've decided that
> BaseTransformer is meant to be an implementation
> helper and one of the
> things it does is take potentially ugly Exceptions
> and wrap them in nice
> TransformationExceptions with comprehensible English
> error messages.
> This is one of the major benefits I think Morph has
> over BeanUtils:
> Morph exceptions have their own hierarchy and
> sensible English messages,
> as opposed to just rethrowing underlying JDK errors.
> So, if someone new
> to Morph writes a simple converter extended from
> BaseTransformer, he or
> she automatically gets this behavior. If the user
> wants to deal with
> his or her own exceptions, it's easy to override
> this method and set
> isWrappingRuntimeExceptions to false.
>
> Beyond this, I also went through every Transformer
> in Morph and overrode
> this method, even if the override also returns true.
> That way, if we
> decide to change the default behavior to return
> false, no transformers
> will break. For basic converters like
> TextToNumberConverter I set this
> to true (the converter is included with Morph, so it
> should throw Morph
> exceptions!). For transformers that delegate to
> other transformers like
> SimpleDelegatingTransformer,
> PropertyNameMatchingCopier and
> ContainerCopier, I set this to false, since these
> transformers don't do
> any real transformations themselves, they just
> delegate to other
> (potentially user-defined) transformers.
>
> Matt Benson, Ben Alex, Alan Stewart - what do you
> all think? I'm going
> to hold off on checking this in for a few hours to
> make sure it sits
> well with me and anyone else out there who's reading
> the list.
>
> Matt S
>
>
-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get
> the chance to share your
> opinions on IT & business topics through brief
> surveys-and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> morph-developer mailing list
> mor...@li...
>
https://lists.sourceforge.net/lists/listinfo/morph-developer
>
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091
|