So... should I postpone my work?
Actually I would have a lot of problems if Szymon Brandys and John Arthorne hadn't shared with me their knowledge (yes, they allowed me to write about this if I put their names in the note).
So, the trick is to put following comment into javadoc:
<p>
IMPORTANT: This class is <em>not</em> intended to be subclassed.
</p>
This little clause is warranty of binary compatibility in case of any changes. Well... actually it indicates there is no warranties at all, and if you try to derive from that API anything its your problem.
Of course I could use
final
clause. But then nobody would be able to use my classes and provide feedback...The trick is called "soft API".
By the way, if you have a second or two please look at new status dialog.
Regards,
Chris
3 comments:
You can't take everything literally. Actually new API looks good, the only issue is that it can be tricky to subclass the new dialog :-)
There is only API and non-API. If you intend for people to subclass to use your new class, then this comment is misleading.
If you don't indend subclassing, then it's fine.
Yes, I do intend subclassing.
But not right now.
Post a Comment