avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: where to use the Component Interface
Date Fri, 01 Feb 2002 15:44:07 GMT
bill pope wrote:

> Hi,
> We have written a number of components that are managed by the Excalibur
> Component Manager. I have a question regrading the use of the Component
> interface. Basically where should it be specified? Should the implementation
> class of the component implement it or should the role interface for the
> component inherit it.
> eg

This is an issue of style.  Obviously, all implementors of that interface
are desiring to be a Component.

> If we have the implementation class implementing component the when we issue
> a release of the component we must use a cast as below
> manager.release((Component)personService);
> If we inherit Component in the role interface we can write
> manager.release(personManager);
> I think the latter is much nicer but as we are new to avalon some guidance
> would be much appreciated. In looking through various samples I have seen
> both approaches used.

That is the consensus of alot of people.  I personally have taken to doing
this, because it just makes things easier.


"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin

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

View raw message