db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <to...@first.fhg.de>
Subject Re: [VOTE] Change package names for junit test classes
Date Fri, 11 Jun 2004 16:37:13 GMT
On Fri, 11 Jun 2004, Chris Greenlee wrote:

> I believe my comment was about protected methods, but Jakob's objection was
> about package-protected methods (which can be and usually are called from
> other classes, and hence good candidates for tests).  So I'm not sure the
> same arguments apply.

I'm not a strong proponent of Java's visibility model, and my least
favourite is the friendly visibility which is flawed IMO for a number of
reasons. Since protected visibility actually 'includes' friendly visbility
(and has the benefit of allowing redefinition which can be avoided with
the final keyword), I believe there is no need for this visibility. And
why it is the default one in Java is beyond me (public or private would
be far better).
So, IMO there should be no package-protected features anyway, only
protected/private and public.

That being said, if it is really required (and for all the thousands of
unit tests I wrote up to now, I haven't been in a situation yet to have
to test friendly - or private for that matter - methods) then they can be
tested even from outside the package.


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

View raw message