JavaFX and the Missing Interfaces (original) (raw)
Randahl Fink Isaksen randahl at rockit.dk
Mon Nov 5 14:54:30 PST 2012
- Previous message: JavaFX and the Missing Interfaces
- Next message: JavaFX and the Missing Interfaces
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
There is a solution to the problem of breaking compatibility when introducing new methods to an interface. That's what the default implementation is for. If you have class Node implement interface SceneNode, then it is my bet that virtually everyone will be extending Node when implementing SceneNode rather than starting from scratch. So you can add method x() to Node while adding an overridable default implementation of x() in SceneNode, and virtually no one will notice. You could even document that extending Node is a prerequisite fore ensured forwards compatibility for an application, and the burden would be off your shoulders.
Randahl
On Nov 5, 2012, at 21:41 , Mark Fortner <phidias51 at gmail.com> wrote:
I guess the benefit of doing it this way is that it would make it easier to swap out implementations, and do unit testing/mocking. The downside if the API is changing frequently then every release is liable to break something. But that's why people have continuous integration servers. :-)
Mark Cheers, Mark
On Mon, Nov 5, 2012 at 12:33 PM, Daniel Zwolenski <zonski at gmail.com> wrote: Maybe somebody can show how this would work in more concrete terms? I don't even see how it would be practical at all.
As in how it would be used by end developers and to what benefit, or as in how to make it workable in the current JFX codebase?
Richard On Nov 5, 2012, at 12:20 PM, Daniel Zwolenski <zonski at gmail.com> wrote: +1 I think we've had this conversation before. Maybe something to do with interfaces being too brittle where if you add a method anyone implementing it will now be missing a method, whereas with a base class they can add a stub method? Other frameworks use interfaces extensively though (eg Spring, java.util.Collections), generally with positive outcomes.
On 06/11/2012, at 5:50 AM, Randahl Fink Isaksen <randahl at rockit.dk> wrote: I have been struggling with a number of problems stemming from the way JavaFX is designed – specifically the lack of interfaces for many of the extension points in the class hierarchy. It takes some thorough explaining with code examples, so instead of just an unformatted e-mail I posted a more readable explanation of the problem on-line: Please read http://blog.randahl.dk/2012/11/javafx-and-missing-interfaces.html I hope we could have a constructive discussion on this matter on this list before I go ahead and file a Jira, so the Jira issue becomes the best possible basis for solving the design problem. Thanks Randahl
- Previous message: JavaFX and the Missing Interfaces
- Next message: JavaFX and the Missing Interfaces
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]