问题
I want to make Dynamic UI for a desktop application. I am planning to make it in JavaFX. Is it a good choice?
Second thing I want to know is that is it possible to have UI by JavaFx and behind the scene major work in done by pure java? I am totally new in JavaFX so correct me if I am wrong.
Also If I am wrong tell me other possibilities for the Dynamic UI and java code behind for a standalone application.
回答1:
Having JavaFX 2 UI and pure Java background is valid and usual approach.
There is a good example in this question: JavaFX in enterprise web applications - good alternative to classic web pages?
回答2:
There's also Swing, SWT, and the Eclipse and NetBeans RCP platforms.
Whether or not JavaFX is a "good" choice, that's more opinion than fact. I wonder about its future. Personally, I like a lot of what's available in Swing combined with a nicer language than Java, like Groovy, JRuby, etc. In an enterprise environment, purchasing a LaF seems a reasonable option.
Yes, JavaFX allows re-use of existing Java libraries; integrating existing code was a design goal.
回答3:
If creating a desktop application with JavaFX is a good choise or not,... I can't tell you. Even the future of JavaFX is unclear. Despite this, it really depends on your aims and requirements (e.g. target audience, maintenance, ...). Maybe, your question has to be more specific. But, if you are your only customer then 'happy coding' with JavaFX :)
Some hints that might help you getting started:
Separation of concerns
To separate UI from all the other stuff is always of high value. A major key is the Separation of concerns. Starting with this article is a good starting point.
Design Patterns
The next step is to decide for a design pattern enabling to separate presentation from the processing of data. Personally, I'm a fan of the Presentation Model. There are many other patterns out there and I'm sure you'll find the one, fitting your requirements. So it is possible - and always a good approach - to use e.g. JavaFX for UI and pure Java for all the other stuff.
Hope this helps.
来源:https://stackoverflow.com/questions/9838884/is-javafx-a-choice-for-dynamic-gui-for-desktop-or-standalone-applications