commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Porter <br...@apache.org>
Subject Re: [exec] vision for the library
Date Tue, 24 Jan 2006 03:10:26 GMT
jerome lacoste wrote:
> Exec was deemed to be an object that makes it easy to use the Executor
> for simple use cases, while Executor was more flexible.

Ok. The names could be better :)

> I'd rather have implementations then we add an interface in a later
> version if we need a remote exec.
> 
> Jerome, trying to use less interfaces

:)

I'm big on interfaces for defining and maintaining a simple public
contract of the API, especially when there is already a proposed use
case. I think adding it later would mean weakening return types in some
instances that would break existing code, limiting the ability to do
that, eg:

class Exec {
}

class ExecFactory {
  Exec getExec();
}

...

Exec exec = execFactory.getExec();

would become:

interface Exec {
}

class Exec implements ExecInterface {
}

class ExecFactory {
  ExecInterface getExec();
}

...

Exec exec = execFactory.getExec(); // needs an explicit cast to compile

It's not a great example or naming, I know.

However, this situation would have to be worked around by adding to the
factory instead of replacing.

WDYT?

- Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message