--- bob mcwhirter <[EMAIL PROTECTED]> wrote:
> 
> Golly, does this break pretty much all existing
> tags?
> (bob scans his bazillion tags...)

Is this drools you're talking about?  Yes, every tag
that throws Exception will no longer compile against
the HEAD of Jelly.  Not desirable, I agree, but also
unavoidable and specifically mentioned in the proposal
made last Thursday:

 
http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=104335501905419&w=2

> I don't really buy the style argument regarding
> making it easier
> for readers vs. authors of tags.  I don't think this
> is a place
> to assert a particular dogma.  

I think it makes a difference some of in the
non-trivial tags.

> The issue, as I see it, is about error-handling. 
> Narrowing the
> type thrown doesn't help me handle my exceptions at
> all.  Jelly doesn't
> care about the type, one way or the other.
> 
> As it stands now, you can certainly narrow the
> exceptions your tags
> throw.  I can throw or handle whatever I want,
> easily, without having
> to handle exceptions I don't wish to handle, purely
> to wrap.
> 
> While now I can do the following and handle
> MalformedURLExceptions
> if I'm able to, and ignore anything I'm unable to
> handle.
> 
> public void doTag(XMLOutput output) throws Exception
> {
>   URL url = null;
> 
>   try
>   {
>     url = new URL( whatever );
>   }  
>   catch (MalformedURLException e)
>   {
>     url = somethingElse();
>   }
> }
> 
> Under the new code I'd have to do this:
> 
> public void doTag(XMLOutput output) throws Exception
> {
>   URL url = null;
> 
>   try
>   {
>     url = new URL( whatever );
>   }  
>   catch (MalformedURLException e)
>   {
>     url = somethingElse();
>   }
>   catch (Exception e)
>   {
>     // a suspicious amount of handling for an
>     // unhandled exception...
>     throw new JellyException( e );
>   }
> }

I'm not sure I understand your example.  URL only
throws one type of exception (MalformedURLException),
which you are catching.  What is the purpose of the
catch(Exception) block?  If your perception is that
you need to introduce catch(Exception) blocks into all
your methods for some reason, or that somehow Jelly is
no longer equipped to handler RuntimeExceptions,
that's not the case. 

I realize these changes create another requirement for
other taglib authors.  I have to weigh this against my
belief that Jelly's internal implementations need
compile-time verification that exceptions are
accounted for and handled appropriately.

> That's not pleasing.  Arguing stylistically, I'd say
> it even forces
> me to inject noise or red-herrings into my code,
> possibly confusing the
> reader.  "Hey, he's catching and handling all
> exceptions" instead of 
> "Hey, he makes no claims about the unhandled
> exceptions escaping
> from this method."

I think users understand what try/catch blocks mean. 
It's only confusing if you aren't picky about using
them and scope whole method bodies with huge blocks. 
Yes, this means you have to handle exceptions.  I
don't want to force you to adopt a particular style,
but I think the alternative leads to a bunch of
undocumented exceptions in Jelly, and that I don't
care for.  It's tough to have it both ways. 

I think the redesign is a short term chore with long
term benefits.  If you truly view the old design as
superior, however, it's probably simple to emulate in
your own projects:

public abstract class MyTagSupport
extends TagSupport {

  public void doTag(XMLOutput output) 
  throws JellyTagException {
    try {
      doMyTag(output);
    } catch (Exception e) {
      throw new JellyTagException(e);
    }
  }

  public abstract void doMyTag(XMLOutput output)
  throws Exception;

}

> If we had an official vote on this, I'd be close to
> -1, hate to say.

Which do you think is better, Jelly this week (no
methods throwing generic Exceptions) or last week (all
methods throwing Excecption).  A veto means we go back
to the old way, where all Exceptions that Jelly throws
are completely undocumented.  To me that's very
undesirable.  

- Morgan

>       -bob
> 
> 
> 
> On Tue, 28 Jan 2003, Morgan Delagrange wrote:
> 
> > ...doTag() signature change stuff...
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


=====
Morgan Delagrange
http://jakarta.apache.org/taglibs
http://jakarta.apache.org/commons
http://axion.tigris.org
http://jakarta.apache.org/watchdog

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

Reply via email to