image
APPENDIX
JavaFX Resources and Where to Go from Here
In this book I have described all the JavaFX APIs that you need to know to work with JavaFX controls. After reading the book, you should be prepared to create the front end of an application with JavaFX. But when developing complete JavaFX applications, you’ll need to know more than this book can contain. Thankfully, the JavaFX community is growing every day, and more information about JavaFX is available than ever before. In this appendix, I introduce additional topics that will be important for developers who are learning JavaFX and provide additional resources where you can learn more. I have also included some statements, knowledge, and approaches from the JavaFX community.
Make Your UI Shine
User experience (UX) is about so much more than a user interface (UI). Whatever you develop should be clean, as intuitive as possible to use, and work in expected ways.
—Mark Heckler (@MkHeck)
Make use of effects and animation. They are cool and can make a big difference. Keep them small and targeted to a specific purpose.
—Dierk König (@mittie)
Most of the samples in this book aren’t very spectacular when you start thinking about all the fancy UI stuff you could add like animations and effects. For a regular business application, these additions aren’t the most important part, and besides, thanks to the Modena theme, all the basic JavaFX controls look good and their skins match each other. But it is still important to choose a good layout, place and use all the controls in the right way, and design an understandable flow through your application. For example, when developing an application such as a music player, all these effects and animations will become more important. Figure A-1 shows a JavaFX demo created by Gerrit Grunwald. As you can see, the UI is completely different from a regular, data-driven JavaFX business application.
JavaFX-Related Middleware and Application Frameworks
JavaFX offers new possibilities to implement UI Architectures. That’s why we created a framework which supports the developer to follow the MVVM approach by using the JavaFX Properties API.
—Alexander Casall (@sialcasa)
As soon as you start writing real-life enterprise applications with JavaFX, you have to consider questions that go beyond widgets and their APIs. You need to set up structures for organizing your code and rules for how to expose functionality to your user. In other words, you need an application architecture. Here I introduce two projects that allow you to implement architecture: DataFX and OpenDolphin.
image
image
FIGURE A-1.An embedded JavaFX application
image
DataFX
DataFX is an application framework for JavaFX. Its main goal is to provide useful architecture and utilities when developing business and enterprise applications. DataFX contains many modules that cover a lot of use cases and technologies that are needed when developing a JavaFX enterprise application.
The DataSource API of DataFX lets you read and write different data sources. This data can be stored in a database or accessed by a REST service on a server. By using the DataSource API, you don’t have to handle all the multithreading issues that are important when working with background tasks or long-running requests. This API is based on the Core module of DataFX and provides a lot of useful functionality to handle concurrent tasks in JavaFX.
Another important part of the DataFX framework is the Flow module. With the help of this module, you can define view-based flows for an application and, therefore, structure the views by using the Model-View-Controller (MVC) pattern. With the Flow API, you can then combine these MVC-based views to create a large flow and links or internal actions. Figure A-2 shows the schematic flow of a master-detail application that can be easily created with DataFX.
All DataFX modules can be combined by using dependency injection. With the Flow API, DataFX even supports context dependency injection (CDI) by providing different scopes.
image
image
image
FIGURE A-2.A design flow that can be implemented with the help of DataFX
Currently, DataFX is the best choice for creating a JavaFX enterprise application that will communicate with a server that provides access by middleware standards such as REST or WebSocket. See www.javafxdata.org for more information about DataFX.
OpenDolphin
OpenDolphin makes prolific use of the Presentation Model pattern. You bind your JavaFX views to a presentation model, while your application code and your tests operate solely by working on this model.
Models are automatically kept in sync between the client and the server such that your controllers can reside on the enterprise server (where enterprise applications are supposed to live and where they can share information).
With the clean separation of concerns that OpenDolphin enforces (controllers managing “what” to display and views knowing “how” to display) comes a long list of benefits: The system becomes easier to modify and extend. It can be easily tested. The UI specifics are kept separate and are thus easier to adapt to new versions and even entirely new UI toolkits. When the UI changes, the server-side logic remains untouched, so all your investment in application logic is protected.
There is even the option to create a totally new class of applications that run on many devices, follow you wherever you go, and foster teamwork by allowing all team members to work on a shared presentation state.
But since seeing is believing, you can head over to http://open-dolphin.org and take a look at the demos.
Best of Open Source Projects
Know your tools: Scene Builder, ScenicView, Gerrit’s converter, your favorite painting program, color picker, gradient editor, and 3D modeling tool in case you do 3D.
—Dierk König (@mittie)
When developing a JavaFX application, you don’t have to do everything on your own. A lot of APIs and frameworks based on JavaFX have been developed in the past few months. Here is a quick overview of some of the most important open source projects:
imageControlsFX, http://fxexperience.com/controlsfx/An open source project that provides high-quality UI controls
imageJFXtras, http://jfxtras.org A general library that provides those pieces developers often need in their day-to-day work but that are currently missing from JavaFX
imageAquaFX, http://aquafx-project.com A Mac OS theme for JavaFX
imageDataFX, www.javafxdata.org An application framework for JavaFX
imageTestFX, https://github.com/SmartBear/TestFX An easy-to-use library for testing JavaFX
imageReactFX, https://github.com/TomasMikula/ReactFX An exploration of reactive programming techniques for JavaFX
Projects are constantly popping up, and I will add an up-to-date list on my web site at www.guigarage.com/javafx-book/.
Important JavaFX Links
Maintain a list of resources for cool designs, tutorials, code snippets, and so on. Prefer “stealing” good work over being original.
—Dierk König (@mittie)
In the past few years, a lot of great JavaFX web sites and blogs have sprung up. The following are the most important ones and will give you a great entry point to the JavaFX community:
imagehttp://fxexperience.com This JavaFX blog was created by some of the JavaFX experts and architects at Oracle: Jasper Potts, Jonathan Giles, and Richard Bair. The blog releases a weekly update of JavaFX news.
imagehttp://harmoniccode.blogspot.de This is Gerrit Grunwalds’ JavaFX blog. Here you can find a lot of interesting articles about JavaFX on embedded devices. (See the end of Chapter 10 for an interview with Gerrit.)
imagewww.guigarage.com Okay, this is more of an ad because this is my blog! Here you can find general articles about JavaFX architecture.
imagehttp://docs.oracle.com/javase/8/javase-clienttechnologies.htm This is the official JavaFX tutorial site by Oracle.
imagehttps://www.java.net/community/javafx This is the JavaFX community web site. Here you can find some interesting news about JavaFX.
JavaFX Books
Learn the many JavaFX 8 ways to be productive when building UIs.
—Carl Dea (@carldea)
image
image
image
FIGURE A-3.The eteoBoard in action
In addition to this book, a few other JavaFX books have been released. Most of these books are general JavaFX books that try to describe the complete JavaFX framework without going too deep into the specific elements. Here are the other books that I recommend:
image  DiMarzio, J.F. Quick Start Guide to JavaFX. McGraw-Hill Professional, 2014.
image  Dea, C, et al. JavaFX 8: Introduction by Example, Second Edition. Apress, 2014.
image  Johan Vos, et al. Pro JavaFX 8. Apress, 2014.
JavaFX Application
One last thing I want to mention is that if you ask yourself whether there are any productive JavaFX applications out there, you’ll find that the answer is yes. For example, at www.eteoboard.de/de/, you can find a scrum board application that was written completely in JavaFX and is used by a lot of companies. The application looks really great, has a cool UI, and is completely touch-based (see Figure A-3). This is a perfect example of what can be done with JavaFX.
Summary
As you can see, the JavaFX community is really big and growing every day. I think JavaFX has a lot of potential and will be used in a lot of cool applications in the next few years. I can’t wait to see all this, and I hope you feel the same after reading this book.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.40.189