InvisibleAbstractMethod
From APIDesign
(Difference between revisions)
JaroslavTulach (Talk | contribs)
(New page: Having an '''abstract''' class with package private ''abstract'' method effectively prevents anyone to subclass it. That can be considered as good [[:APIDesignPatterns|API design patte...)
Next diff →
Revision as of 17:41, 9 March 2012
Having an abstract class with package private abstract method effectively prevents anyone to subclass it. That can be considered as good API design pattern, especially if that is something one starts with.
However it can also turn into a huge anti-pattern. Adding first package private abstract method into an abstract class is in fact an incompatible change. If the class used to be subclassable before, this prevents it and as such classes that used to compile may compile no longer.
The hidden catch is that tools like Sigtest are unlikely to catch this situation, as they don't care about package private methods!