• Post Reply Bookmark Topic Watch Topic
  • New Topic

Frameworks with outstanding exception handling  RSS feed

 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to all,

What frameworks (commercial/opensource) stands out in their excellent use of exceptions ? For example, what do you think of Struts declarative exception scheme ?

Pho
 
Steve Stelting
author
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pho Tek,

I looked into the handling models for Struts, JSF and Spring while researching a presentation on Web tier exception handling earlier this year. My personal (admittedly biased) perspective was that each model was well planned, but based on slightly different framework handling philosophies.

For instance, I got the impression that Craig wanted strike a balance in Struts... to create a handling framework that supported "plug-in" handling for some of the commoner errors, but was still open enough to support more sopisticated customization. That seems to mesh well with the more general goal of the framework - to provide a core programming model (MVC controller driven) that can be used out of the box, or customized to build more sophisticated solutions.

In JSF on the other hand, the focus is very much on ease of programming and support for automated, IDE-driven efforts. As a result, its handling framework supports things like error page redirection and validation... standard MVC view-related error reporting that can be easily integrated into applications with minimal customization. For more detailed customization, I think developers would generally tend to fall back to the core Servlet/JSP handling structure, rather than modifying the JSF framework itself.

It seems that Spring represents a sort of "reference implementation" of many of the best practices for lightweight enterprise development that Rob Johnson described in his popular Wrox press titles. From an exception handling point of view, this is reflected in the fact that the framework focuses to a large degree on RuntimeExceptions as the vehicle for communicating errors, which developers can handle (if desired) or which can be addressed by his enterprise infrastructure if left unhandled.

As a student of architectures, I think there are lessons to be learned from each framework... they give us insight into a worldview of how to deal with errors in code. If developers are interested, I'll dig up the work I did earlier this year and post it to Javaranch (with permission of the Saloon keepers, of course!) when I get back to the U.S.

Steve
 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve,

Thanks for the long response. Looks like it's about time for me to learn Spring. Although I find that these new supposedly container-less frameworks are quiet different from the EJB beasts that we're used to. For one thing, EJB forces developers to possibly handle exceptions across distributed web and EJB tiers.

That framework comparison would be well appreciated. As well, it might be suitable to be published in Javaranch's monthly newsletter?

Regards,

Pho
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!