Link Details

You have the power. Login and vote now.
Link 76662 thumbnail
User 241715 avatar

By dlinsin
via dlinsin.blogspot.com
Published: Apr 20 2008 / 21:28

Give me some advice on how to handle error messages and I18N, when dealing with Exceptions!
  • 11
  • 1
  • 1612
  • 564

Comments

Add your comment
User 219537 avatar

trevor replied ago:

0 votes Vote down Vote up Reply

I like the idea of enumerating the specific problems in the more generic Exception class, but I don't think the Exception itself is the proper place to be doing user messages/localization. It is pushing view layer concerns into the control layer.

It would seem to be more maintainable if the Swing/MVC Action classes/etc. simply looked up in ResourceBundles the display strings based on the exception's type they caught.

User 241715 avatar

David Linsin replied ago:

0 votes Vote down Vote up Reply

Hi trevor,

thx for your feedback. I totally agree that in terms of layering and responsibility you shouldn't handle view layer concerns in any other layer than the presentation tier. On the other hand you might wanna produce a language specific log file or send an internationalized Email through some back-end service. Don't you think a generic Exception class handling this concern would be a clean designed solution?

Writing this almost seems like this problem is a cross-cutting-concern...

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (11)



Voters Against This Link (1)