On 11/08/2003 14:03 Jerry Jalenak wrote:
Thanks for the replies - interesting to note that all three of you suggested basically the same answer, that of using the exception mechanism. When implementing this, do you code individual, specific exception handlers (i.e. InvalidUserException, etc), or do you have a generic handler that you can pass a 'cause' back through?
I find that a generic mechanism gives better code re-use. My business layer exceptions extend a generic ModelException e.g., ModelRuntimeException would indicate a DB error, ModelValidationException for a validation error... I catch the ModelException and pass it to a protected base-class method for further processing. This method returns a String which is used to look up the forward (usually either return to input page or forward to "database error" page).
--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller Business |
| Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]