Re: [picocontainer-dev] Exception as message passing in ConstantParameter
Konstantin Priblouda <kpriblouda-/[email protected]> Mon, 7 Jul 2008 08:24:13 -0700 (PDT)
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
--- On Mon, 7/7/08, Paul Hammant <[email protected]> wrote: > We could use a callback. Such that .. > > void verify(PicoContainer container, Co ... etc > > .. would become .. > > Verification verify(PicoContainer container, Co ... > etc > > public class Verified implements Verification { > } > public abstract class NotVerified implements > Verification { > public abstract void throwCause(); > } > > It implies that if you have verification exceptions, you > throw then > via callback impl of NotVerified Well, this means even more compelxity (and API is already pretty complex) > It also implies some if/else checking in various bits of > the verify > hierarchy On the other side, when do we need exception? If verification is invoked as part of starting container / retrieving of component, then exception is a good solution. If on user request - then not. Maybe we shall split it in 2 parts? Or offer wrapper method for visitors (throwing exception, protected) regards, --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email