So this has been bothering me for a while.  I talked about this a while
ago and it went in circles so here it goes again.

When using Turbine as an API it is very hard to keep track of your
Exceptions.  Instead of declairing that a method throws "Exception"
let's create a new class named TurbineException that extends Exception:

So instead of:

if ( rawMessage == null ) 
  throw new Exception ( "MessageResources: rawMessage is null" );

we would have

if ( rawMessage == null ) 
  throw new TurbineException ( "MessageResources: rawMessage is null" );


Why?  

1.  IMO is cleaner and a better way to design apps.
2.  If you have code that uses multiple Turbine APIs and say JDBC you
would have to declair that it "throws Exception".  However if Turbine
were to throw TurbineException our new method could "throws
TurbineException, SQLException".

Is there any major reason we *have* to use Exception instead of a
TurbineException?  I am -1 on proceeding further on this.  I was
debuging some code recently and this bit me.  Not hard to figure out but
when you see that you aren't catching "TurbinException" you instantly
know it is a Turbine problem.  

Thoughts?

Kevin

-- 
Kevin A Burton ([EMAIL PROTECTED])
http://relativity.yi.org
Message to SUN:  "Please Open Source Java!"
"For evil to win is for good men to do nothing."


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to