[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Exception handling
It is all about interface driven programming. C# does not have checked
exceptions. Bruce Eckel things that Checked Exceptions is no longer a
good idea, while James Gosling used to think otherwise. U ask Bjarne
Stroustroup & he will tell u he loves compile time checking vs. runtime
checking. I like compile time checking, I want the users of my
interface to know how my interface will behave. In Java there is no way
other way of returning errors other than to define application
exceptions. More so in EJB interfaces, I like my users to know what the
behaviour of the interface is & they be prepared to handle it, else
unchecked exceptions will be thrown on the client's browser. Java
recommends that unchecked exceptions be thrown by the JVM which equate
to runtime exceptions.
--- Poorav Chaudhari <pooravc@yahoo.com> wrote:
> Hi Rajan,
>
> Thanks for your response. I would just like to point out that I do
> not have any
> EJBs, anyhow I can use a similar approach with my Data access
> objects. can you
> be a little more specific as to what you mean by application
> exceptions. I was
> reading a write up which talked about when to throw checked
> exceptions and when
> to throw unchecked exceptions. The article also pointed out that
> throwing
> custom exceptions that did nothing more than just extend the
> standard
> Exception, was not a very smart implementation. any thoughts on that?
>
>
> Thanks.
> Poorav
> --- Rajan Gupta <rajangupta@rocketmail.com> wrote:
> > One possibility is
> > Services from the EJB tier raise application exceptions, which are
> > caught by service delegates or Action classes depending upon your
> > abstraction on the client tier. Each application exception caught
> in
> > the Action class is translated to a key in application resources,
> the
> > error is stored using saveErrors() & then finally displayed in the
> JSP
> > page using the <html:errors/> tag.
> >
> >
> > --- Poorav Chaudhari <pooravc@yahoo.com> wrote:
> > > Hello,
> > >
> > > I am developing a struts based application. Mostly everything is
> > > running
> > > smoothly. But I am having difficulty coming up with an effective
> > > structure for
> > > exception handling. How should the exceptions be handled at the
> data
> > > access
> > > layer, and how should they be handled at the business layer (i
> don't
> > > have any
> > > ejbs). I have read a few articles on the web regarding this, all
> they
> > > have done
> > > is gotten me a little more confused! I would really like to see
> how
> > > some of you
> > > have handled this. suggestions, tips, examples are all very
> welcome,
> > >
> > > waiting in anticipation.
> > >
> > > =====
> > > - Poorav
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Protect your identity with Yahoo! Mail AddressGuard
> > > http://antispam.yahoo.com/whatsnewfree
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Free Pop-Up Blocker - Get it now
> > http://companion.yahoo.com/
>
>
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
>
__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/