From: Steve Loughran [mailto:[EMAIL PROTECTED]]
> ----- Original Message -----
> From: "Peter Donald" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, March 27, 2001 4:06 PM
> Subject: Re: Ant q? about core Java task: why are members private?
>
>
> > At 06:53 27/3/01 -0500, Eric Siegerman wrote:
> > >On Wed, Mar 28, 2001 at 09:43:05AM +1000, Peter Donald wrote:
> > >> I would prefer to keep everything as protected (unless
> > >> we provide accessors to them)
> > >
> > >Why *not* provide accessors?
> >
> > That would be excessive work ;) Though if someone else was
> to do it ...
>
> +1 on 'recommend that all new tasks to provide accessors to
> their (private)
> member variables'. Making things accessible to subclasses effectively
> freezes the base implementation.
Exposing things through accessors is not necessarily any better.
Just because a class has a private variable, that does not mean that
it should provide any means of access to them.
Doing so, will increase the contract between the core task, and
other tasks, in ways that might not be appropriate.
Anything that is accessible in XML is already accessible to sub-tasks
through the setXXX() methods. Adding additional access is exposing
more implementation details that may not be appropriate.
-0 on this recommendation.
+1 on "For core tasks, consider what interface/contract is appropriate
to allow for extensions"
