ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <>
Subject Re: Ant2 suggestions
Date Tue, 17 Jul 2001 09:06:58 GMT
From: "Maurice le Rutte" <>
> ----- Original Message -----
> From: "Kurt Huwig" <>
> > Inheritance of fields is a Bad Thing (tm) IMHO.
> I've always thought that inheritance of fields was one of the core things
> OO...

Well, allowing protected access does break the super class' encapsulation,
allowing the subclass to violate the class invariant of the super class.
So, in general, it is a bad thing. Providing accessors is not much better,
though, unless you can restrict what the caller can do to the object (eg,
const in C++). In the case of Ant tasks, the project field is not really
part of the task's invariant, so protected access is not generally harmful.


View raw message