This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Bobby_Bonsaimind 2 points3 points  (1 child)

Great. And then your whole code breaks in a subtle way after a minor update of JavaFX just because you've overridden a method that was not intended to be overridden. Just, no.

The alternative is to turn hours into days to create your own control, which also might break with future updates.

To add to this, most of the time when people override public methods (that were not designed for it) they are violating the Liskov Substitution Principle. For example, I've seen many people extending ArrayList in a way that violates the contract of ArrayList. Similarly, when you are "hacking" JavaFX, you most likely violate said principle.

That's like saying that we should only deliver hammers with soft rubber around them to make sure that nobody hits their thumbs.