> From: Leo Simons [mailto:[EMAIL PROTECTED]] 
> 
> 
> RuntimeException vs declared Exception vs no exception 
> ======================================================
> The reason for using RuntimeExceptions instead of declared 
> exceptions. is that it saves the component writer a 
> try/catch/finally block. The disadvantage is that it is 
> perfectly valid for lookup() to fail.
> 
> When the only reason for lookup() to fail is nonexistence of 
> a requested component, requiring a call of exists() before a 
> lookup() removes the need for a declared exception, or even a 
> RuntimeException.
> 
> If we are sure that the only possible failure is a 
> nonexistent component then no exception at all is necessary 
> if calling exists() is mandatory.
> 
> Is this true? I think so.

I would be for just removing the exception altogether.


> >    - Possible interface to have DefaultComponentManager defer all
> >      lookups to the Container
> 
> ??
> 
> Like Stephen, I wonder whether defining a Container interface 
> is a good idea. Don't really see the need. Please elaborate?

All I am talking about is something like this:

interface Container
{
    Object getComponent(String name, String/*Object*/ hint);
}

The DefaultComponentManager would call the Container that was
passed in the constructor and that in turn would call the
getComponent(name, null) for default or getComponent(name,hint)
for more specific.

Kind of the way Fortress works--but more formally state it that
way.


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

Reply via email to