--- Jeff Turner <[EMAIL PROTECTED]> wrote:
> On Sun, Jul 01, 2001 at 03:58:25PM -0700, Berin
> Loritsch wrote:
> > IoC does not really apply to Exception handling.
> > Logically, all that is happening is that the
> method
> > is returning early with a class that has error
> > information attached to it.  It is well understood
> > for most programmers.
> > 
> > Using any other approach only serves to add a
> layer
> > of complexity with no real advantage.
> 
> That depends on the component. If your component
> requires deferred or
> non-critical exception handling, try/catch isn't
> good enough. That's why
> Mr Megginson came up with org.xml.sax.ErrorHandler.
> 
> Perhaps I'm not alone in this.. I've always thought
> of SAX as *the* most
> widely known example of IoC in a Java API. As such,
> it seems natural to
> wonder whether SAX's unusual error handling is a
> consequence of it's
> "invertedness", and if so, whether this has
> implications for Avalon.

SAX is not IoC.  SAX is an Event Handling framework
designed to communicate the structure of an XML
document one piece at a time.  When you have
Components that employ Event Handling (like SAX),
then the ErrorHandler approach is a natural extention
to the framework because you now have new event types
to handle.  There is no control explicitly
communicated
between the Event Producer and the Handler.

The key distinction between SAX and IoC is the
semantic of Information vs. Control.  SAX is
information based--not control based.  The interfaces
in Avalon are IoC because the contracts state that
the target Component/Object is being controlled by
another.

Remember, you must use the right tool for the job.
Sometimes you need a sledgehammer, and sometimes you
need rubber mallet.  Keep in mind the distinction that
I laid out for you above.  Event Handling information
frameworks are served quite nicely by Error Handling.
Component creation and lifecycle management are not
cleanly served by that approach.

> (Looking forward to that Avalon whitepaper/research
> thingy of yours:)

It is in CVS (in DocBook format), and I have one last
section to put in.  Finding time is difficult though.


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

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

Reply via email to