7

"The combination of Java and JavaFX stands for maturity, security, reliabil...

 1 year ago
source link: https://devm.io/java/javafx-19-vos
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Interview with Johan Vos, Java Champion and Gluon co-founder

"The combination of Java and JavaFX stands for maturity, security, reliability, scalability, and maintainability"


We spoke with Johan Vos, Java Champion and co-founder of Gluon about JavaFX and the latest release. We discussed its strengths, the developer community, and JavaFX's long journey. Learn about the most important new features in JavaFX 19 and what's planned for future updates.

devmio: Thank you for taking the time to answer our questions. First, for those who are new to JavaFX, could you tell us what it is and what developers use it for?

Johan Vos: JavaFX allows Java developers to create modern, cross-platform user interfaces. Rich client Java applications that require interactions with users, or that need a simple or complex visualization can benefit from the JavaFX API's and implementation.

JavaFX is applicable to a wide range of applications in different environments, e.g. science, finance, entertainment, education, and engineering. JavaFX applications can be executed on a large amount of devices, ranging from embedded and mobile systems to desktops.

It is developed under the OpenJDK umbrella (where the core JDK is developed), as a separate project. The fact that it is a separate project allows us to be more flexible with roadmap, goals, distributions, etc. At the same time, we can benefit from the infrastructure and methodologies that make the Java core development so great.

devmio: It’s a busy month for Java. JDK 19 released on September 20th, 2022. How will new features from JDK 19 interact with JavaFX 19? Will users need to upgrade at all after the new release?

Johan Vos: The minimum requirement to run JavaFX 19 is Java 11. We deliberately did not use more modern Java language features inside JavaFX 19, in order to give users who can not easily update to the latest JDK still access to the latest JavaFX release.

Of course, it is very well possible for developers to use Java 19 when developing their JavaFX based applications. They can easily use all the great features of JDK 19 in applications that are using JavaFX.

The fact that it is a separate project allows us to be more flexible with roadmap, goals, distributions, etc. At the same time, we can benefit from the infrastructure and methodologies that make the Java core development so great.

devmio: Looking at the JavaFX 19 release notes, what are the most important changes this update adds?

Johan Vos: One of the main priorities in every JavaFX release is stability. In the Java world, and by extension in the JavaFX world, developers and users rely on the fact that the code you write today will still run on the systems from tomorrow. While this may sound trivial, it is not.

Operating systems evolve, internal API's change, new graphical standards come and go. We want to make sure that JavaFX application developers are shielded from these lower-level, OS specific details. That always requires a number of changes that are often not visible to developers, but crucial for the long-term reliability of JavaFX.

A major feature in this particular JavaFX release is the improved HTTP live streaming with the support of H.265/HEVC. With the increasing interest in real-time media components in desktop applications, this makes JavaFX a strong candidate as the platform to build those applications.

Developers can also benefit from an enhanced API for bindings. With the new type-safe additions, it becomes easier and less error-prone to work with JavaFX bindings.

devmio: Are there any notable bug fixes or errors that this update addresses?

Johan Vos: There is a long list of bugs that are fixed in the JavaFX 19 release. The release notes at https://github.com/openjdk/jfx/blob/master/doc-files/release-notes-19.md contain the list of fixes.

Fixing bugs is important, but it is also very important to avoid regression. We don't want bug fixes to introduce new bugs, and we also don't want that a bug that was previously fixed to show up again due to new code being added.

Therefore, we have a strong focus on regression tests. For every bug fix that is done in the OpenJFX code base, we add additional unit tests. Those tests fail before the fix is applied, and pass after the fix is applied. Since those unit tests are executed before new code can be committed to the OpenJFX repository, this guarantees that the same bug can not occur again.

Fixing bugs is important, but it is also very important to avoid regression. We don't want bug fixes to introduce new bugs, and we also don't want that a bug that was previously fixed to show up again due to new code being added.

devmio: Can you share with us anything from the roadmap for future versions? What is currently in progress for the next update and what can users look forward to?

Johan Vos: As usual, stability is one of the most important goals. Apart from that, we are working on improvements in the ListView, TableView, and TreeTableView controls, to make sure they work well in a large number of scenarios (ranging from small lists with animations inside the cells to huge lists that may have lots of data being added on-the-fly).

JavaFX 20 will contain an important update of the Marlin renderer which does not only contain bugfixes but also some (performance) enhancements.

A major change (that is mostly internal to the OpenJFX development) is that starting with JavaFX 20, the minimum required JDK version jumps from JDK 11 to JDK 17. This allows the OpenJFX developers to leverage features in the JDK that are introduced after the JDK 11 release. Amongst other things, this should in turn lead to better and more maintainable code.

devmio: JavaFX has been through several different licenses and started out at something quite different than what it is today. Could you explain to us a little about the journey JavaFX has been on?

Johan Vos: When JavaFX was announced as the new client framework for Java by Sun in 2007, it was a separate component and not bundled with the core JDK.

During the lifetime of Java 8, JavaFX was added into the Oracle JDK distribution. The code was developed in a separate repository though.

With the Java Modular Platform System introduced in JDK 9, the concept of the "JDK distribution" somehow changed. Modules can easily be added to a JDK without them being part of the core JDK. Also, developers were increasingly using tools like Maven and Gradle to declare and deal with dependencies. Hence, the JavaFX library was no longer bundled with the Oracle JDK distribution starting from JDK 11. At that moment, Gluon started to create JavaFX releases in 2 options. Developers can download the JavaFX SDK or jmods as separate bundles and add them to their JDK configurations. Alternatively, developers can declare a JavaFX dependency in the pom.xml or build.gradle file of their Maven or Gradle projects, which will result in the JavaFX artifacts to be retrieved from Maven Central.

While some of the decisions were completely out of control of the JavaFX developer community, I believe we always managed to turn whatever decision that was taken into a positive evolution, both for JavaFX as for the wider ecosystem.

Unfortunately, security and the privacy of users is often sacrificed for tracking tools and advertising revenues. A lot of Web frameworks that are popular and fancy today, will not be supported anymore tomorrow.

devmio: What do you hope for the future of JavaFX? Do you believe its future mostly lies in mobile applications or on the web?

Johan Vos: One of the strengths of JavaFX is exactly that an application created in JavaFX can run on mobile, embedded and desktop systems. Hence, in case the target audience should be reached via different channels, JavaFX is an obvious choice.

The combination of Java and JavaFX stands for maturity, security, reliability, scalability, maintainability. This makes JavaFX very suitable for applications where these characteristics are important. Many web projects that are popular today are based on the opposite principles. Unfortunately, security and the privacy of users is often sacrificed for tracking tools and advertising revenues. A lot of Web frameworks that are popular and fancy today, will not be supported anymore tomorrow.

JavaFX provides an answer for projects where things like security, privacy, and maturity are important and that, at the same time, require outstanding visualization capabilities. This makes it very applicable in e.g. multi-platform messaging systems, scientific visualizations, financial systems etc.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK