ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: [DISC] core extensions
Date Mon, 02 Apr 2001 09:26:17 GMT
Just for the record, as I seem to come through as "anti-interface"
because I argue against making all data-types interfaces and making
Task an interface: This is not true, I like to use interfaces, but not
everywhere, just because we can. 

There are places where interfaces are not appropriate IMHO. One
situation is where the contract between a Task and the core (or
TaskEngine) is more than just "Tasks have to adhere to a given
interface", but this contract also involves some rules about how to
implement that interface.

Say we have setTaskContext and getLogger methods in the interface and
one rule was that getLogger must return the Logger set via the
TaskContext - add a ton of more rules to this. You cannot enforce this
contract when you use an interface, this is where I'd see an abstract
base task with a final getLogger method. (I know that one copuld
massage the interface to pass the TaskContext to every method call,
this is just an example.)

Given that we've not hashed out the contract between Tasks and the
core, this discussion is obviously premature and I'll stop here.

Peter Donald <donaldp@apache.org> wrote:

> However the main reason for separation between
> interface/implementation is to force us developers to design things
> well. It is much harder to justify adding onto an interface on a
> whim than it is to add an extra method to a class ;)

Sure? 8-)

Stefan

Mime
View raw message