On Wed, 24 Oct 2001 08:04, 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??
Naah thats fine. I guess there are different categories of "interface" in our
framework.
* There are lifecycle interfaces - Composable, Configurable, Startable etc
* There are structural interfaces - Component and Block
* There are work/service interfaces - Scheduler, ConnectionManager
It is fine to have multiple lifecycle interfaces and it is fine to have at
most 1 structural interface. However you should probably only have one
work/service interface**
** however there is an exception to this. Sometimes you may want to expose
the same sort of functionality but via different interfaces for different
users. For instance consider the following.
interface Fooable {}
interface ExtendedFooable extends Fooable {}
class DefaultFooable implements ExtendedFooable {}
In this case I would consider it completely acceptable. I could even be
convinced that the following is good practice in certain situations
interface Fooable {}
interface ExtendedFooable extends Fooable {}
interface MicroFooable {}
class DefaultFooable implements ExtendedFooable, MicroFooable {}
but it really depends on the situation.
--
Cheers,
Pete
Frank Zappa observed: "It's not getting any smarter out
there.You have to come to terms with
stupidity, and make it work for you."
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]