> -----Original Message-----
> From: Dmitri Valdin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 04, 2002 4:18 PM
> To: Struts Developers List
> Subject: Re: declarative exception handling/resource bundle access
> 

...
> 
> > and elegant, not to mention quite useful.  ok, enough gushing...
> 
> The original idea comes from Donlan Laine
> 
> http://www.mail-archive.com/[email protected]/msg0
3281.html

i actually remember reading it when it was first posted and being very
excited about it.  i'm just now getting around to reaping the benefits.


>>oh yeah, another thing...  ExceptionHandler needs to have a corresponding
>>interface.  the struts-config allows you to specify an different exception
>>handler for each configured exception, but RequestProcessor always casts
>>whatever you specify here as ExceptionHandler, so if you did override it,
>>you'd get a ClassCastException.
>
>But if you derive your exception handler from ExceptionHandler, then you
>won't
>get this exception. Won't you ?
>
>Dmitri Valdin

while i realize that i can subclass, this really doesn't seem like the
"right" thing to do here.  i'm familiar with the reasons that subclassing is
used in other places in struts (where interfaces have been suggested, i.e.,
Action), but i don't see how that applies here.  all that should be required
here is that i have an execute method with the appropriate arguments.  

plus, if you're a sloppy typist (like me), there's that most important
benefit of interfaces: the compiler acts as a spell-checker!  if you
subclass and misspell a method name, the compiler could care less.  (coming
in a close second :-) is the fact that if the interface changes, all
implementors of that interface no longer compile -- which also doesn't
happen with subclassing.)

ab

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to