avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gonzalo A. Diethelm" <gonzalo.dieth...@aditiva.com>
Subject RE: [proposal] avalon 5 ComponentManager interface
Date Fri, 21 Jun 2002 09:26:10 GMT
> > ComponentException is a
> > system exception not an application system and should be handled by the
> > container not by individual component. Receiving a ComponentException
> > should mean that the whole component is fubared.
> 
> I simply disagree on the concept, but it doesn't matter as long as there
> is a way to ask to the container if a component is present in the system
> without having to catch an exception.

I'm a non-committer and a total Avalon newbie, but I just can't resist.
In the olden days (read: C programming), it would be OBVIOUS that you
would do

  Component c = container.lookup(name);
  if (c == null)
    // not found
  else
    // found

I know having the exists() method achieves the same, but any sane
programmer would retch at the idea of doing TWO searches, one to
ensure the component is there, one to retrieve it.

There, I said it. Perhaps this doesn't apply in the Avalon world, but
I fail to see why lookup() couldn't just simply return the component
when it is found, or null in any other case.


-- 
Gonzalo A. Diethelm
gonzalo.diethelm@aditiva.com


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message