Gerhard Froehlich wrote:
> 
> Hi,
> actually I'm working on a problem to fulfil
> following rule in dev guide of the avalon
> framework:
> "Don't extend any other interface. If you think that
> you should extend another interface, it should be
> another role's work interface."
> 
> I've following problem:
> In my new component I want to use your PriorityQuery.
> In the current implementation I extended the interface
> of my component from Component and PriorityQuery.
> My component implements this interface of course and
> everything is fine.
> But this is not best practice.
> 
> Can you give me a little push in the right direction??

The example you gave is perfectly fine.  You have two
choices: you can have the work interface extend Component,
or you can have the implementation extend that interface.

If the work interface extends Component, that means that
the work interface will always be a component--and the
advantage is that you don't have to explicitly cast the
instance when you release it:

manager.release((Component) queue);

If the implementation extends Component, it is because you
might be using the work interface in a number of ways--not
only for components--or you might simply not have access to
change the interface.

When we describe the best practice, we are referring to
one component trying to implement multiple work interfaces.
basically, I am of the mind that a Component, in order to
be reuseable and maintainable, must do one thing, and do it
well.  It is fine and correct for it to implement multiple
lifecycle interfaces and a lifestyle interface.

Please point me to the verbage that caused confusion, I would
like to make sure it is more clear for the next release.

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

Reply via email to