ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Eison <ei...@arsdigita.com>
Subject Please consider protected instead of private visibility modifier
Date Tue, 19 Dec 2000 07:45:20 GMT
In Ant 1.2, the default ant classes use the private modifier on all data
fields, without providing any protected or public interface to get to
the fields.

This makes subclassing these classes mostly worthless.  For example, the
Path class can not be subclassed to use the directory scanner's
getIncludedDirectories method, because the list() method can't be
replaced since the elements object is private.  The CallTarget method
can not be extended to execute differently since the callee object is
private.  The list goes on... basically a subclass can not obtain any
priviledges beyond what a normal calling class could do, leading to the
undesirable cut-and-paste system of extending.  Could you please explain
this choice of the private visibility modifier, or reconsider and use
protected in the general case instead?

Thanks,
David

P.S. if I need to send this sort of request somewhere else, please
direct me.  Thanks.

--
David Eison                     W: 404-917-2617
eison@arsdigita.com             H: 404-287-6648




Mime
View raw message