blue-infinity White Paper on JavaFX by Jan Stenvall
Upcoming SlideShare
Loading in...5
×
 

blue-infinity White Paper on JavaFX by Jan Stenvall

on

  • 5,274 views

blue-infinity consultant Jan Stenvall's white paper on JavaFX

blue-infinity consultant Jan Stenvall's white paper on JavaFX

Statistics

Views

Total Views
5,274
Views on SlideShare
5,274
Embed Views
0

Actions

Likes
0
Downloads
136
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

blue-infinity White Paper on JavaFX by Jan Stenvall blue-infinity White Paper on JavaFX by Jan Stenvall Document Transcript

  • White Paper JavaFX 2blue infinityVersion: 1.0 RC2Date: 10.01.2012Submitted to:Author: Jan Stenvall Sébastien Vandenbergh (supervisor)Contact:
  • White Paper JavaFXTable of Contents1. Introduction ............................................................................................................... 32. Business Analysis ....................................................................................................... 43. Architecture ............................................................................................................... 53.1 Background .............................................................................................................. 53.1.1 Architectural Overview ........................................................................................... 53.1.2 UI Design Architecture ........................................................................................... 53.1.3 Java APIs for JavaFX Features ................................................................................. 63.2 Hardware and Software Compatibility .......................................................................... 73.2.1 Operating Systems – Windows, OS X, GNU/Linux, iOS, Android .................................. 73.2.2 Dynamic Languages for JavaFX – Groovy, Scala, Clojure ............................................ 73.2.2.1 GroovyFX / ScalaFX ............................................................................................... 73.2.3 Support for other platforms .................................................................................... 83.3 Comparison Chart ..................................................................................................... 83.3.1 Third Party Frameworks and Libraries .................................................................... 103.3.1.1 JRebirth ............................................................................................................. 103.3.1.2 MigLayoutFX ....................................................................................................... 113.3.1.3 JFX Flow ............................................................................................................. 113.3.1.4 DataFX ............................................................................................................... 113.3.1.5 RedFX ................................................................................................................ 114. Development ............................................................................................................ 124.1 Development Environments ..................................................................................... 124.1.1 JavaFX IDE Support ............................................................................................. 124.1.1.1 NetBeans ........................................................................................................... 124.1.1.2 Eclipse ............................................................................................................... 124.2 Visual Design Development ...................................................................................... 124.2.2 UI Design Capabilities .......................................................................................... 134.2.2.1 Designer – Developer Workflow ............................................................................. 134.2.2.2 CSS Capabilities .................................................................................................. 144.3 Testing .................................................................................................................. 154.3.1 Unit Testing the UI Model ..................................................................................... 154.3.2 FXML Dependency Injection .................................................................................. 154.4 Best Practices ......................................................................................................... 154.4.3 Patterns and Architecture ..................................................................................... 154.5 Deployment ........................................................................................................... 164.6 Continuous Integration Support ................................................................................ 164.6.1 Build Tools.......................................................................................................... 164.6.1.1 Ant Support ........................................................................................................ 164.6.1.2 Maven Support.................................................................................................... 164.6.2 Sonar Rules ........................................................................................................ 174.6.3 Performance Tests ............................................................................................... 175. Road Map.................................................................................................................. 186. Conclusion ................................................................................................................ 197. References ............................................................................................................... 20© blue-infinity, proprietary and confidential page 2 of 20
  • White Paper JavaFX1. IntroductionBackgroundThis white paper will, in the changing world of information technology, provide guidance in choosingwhat RIA platform to commit to.When you are about to choose a platform, you will face enterprise-grade considerations like; How longwill these platforms be around? Which platform is best suited to meet the business and end-userrequirements? How is the performance under heavy data crunching, multitasking or other CPUintensive operations and will the platform scale to handle an expanding future?Integration with legacy systems, data structures, client machines and business processes will all informthe choice of a UI technology. The CIO will also point out the fact that previous investments must bepreserved and utilized to the maximum.Current SolutionsThe two products Adobe Flex™ and Microsoft Silverlight™ are ruling the market of rich UI frameworks.These are mature and have a broad market penetration. And many of the mentioned considerationsand challenges are handled by these platforms. The companies backing Flex™ and Silverlight™ arereviewing their investments and are turning, slowly but firmly, their attention towards HTML5. Interestfor Flex and Silverlight is declining; the trend is visible on Google Insight for Search (Google 2011).Figure 1. Google Insights for Search show relative interest levels of Flex (red), Silverlight (yellow) and JavaFX (blue).However, HTML 5 is still in its infancy, at the moment and in the near future. Today is this technologycertainly not a complete replacement for Adobe Flash™ or Microsoft Silverlight™. These frameworks,including HTML 5, may be valid options under many circumstances, but will not answer the call formore sophisticated, complex and richer web experiences. And, in times of cost-cutting andconsolidation of services, there are more at stake.JavaFX 2This paves the way for JavaFX 2 (hereafter JavaFX) which has been updated to face the enterprisechallenges. With the strong backing from Oracle, JavaFX is a serious contender in the UI Frameworkarena. Since JavaFX is built using Java, in concert with and for the Java community, it means that hugeinvestments and the amassed Java knowledge can be reused. This minimizes investments and brings afaster return on investment.According to the TIOBE Programming Community Index (TIOBE 2012), Java is still the number onerated programming language. Java has a long track record and has been proven in the enterpriseenvironment. This along with a strong Java developer community will empower the adoption of JavaFX.© blue-infinity, proprietary and confidential page 3 of 20
  • White Paper JavaFX2. Business AnalysisRich Internet Applications (RIAs) are, according a report from Forrester (2010), frequently used fordelivering complex and valuable online experiences. Although the term RIA is likely to fade away, thepresence of several RIA technologies will still be the key to deliver online experiences that will satisfycustomer demands for complex and visually compelling User Interfaces.As they look to create great online experiences of the future, customer experience professionals shoulduse RIAs for modernizing existing online functionality, building transformative new experiences, andcreating emotional connections with users.Oracle is stepping up to the challenge and is increasing its investment in JavaFX, according to a recentpress release (Oracle 2010). And just like Adobe Flex™ is Oracle opening up JavaFX to the open sourcecommunity. This will enable the Java community to influence the direction of the future of JavaFX.Oracle will, unlike the handover of Adobe Flex™ to the Apache Foundation, officially back thecommunity and will be at the helm of the OpenJFX organization. The JavaFX runtime will be a vital partof the Java SE Development Kit 8.Reuse InvestmentsJavaFX applications are completely developed in the Java programming language, one of the mostwidely adopted technologies to develop and deploy software applications, which leverages standards-based programming practices and design patterns. All your previous investments can be preserved byreusing Java libraries in JavaFX applications.Consultant ProfileBenefitting of the fact that the JavaFX stack is pure Java, companies and developers can leverage theirJava skills and it will be easier to find experienced consultants. They can use their favorite Javadevelopment tools, such as the NetBeans and Eclipse IDEs. Hence, the learning curve is steep as Javadevelopers will easily be acclimatized to Java and the JavaFX 2.x API.Comparing job offer trends, reveals that the UI frameworks Flash™, Flex™ and Silverlight™ trails thejava job trend. The demand for Java developers are more than 15-fold greater. The continued highdemand for Java developers is a safeguard for a wide adoption of Java and JavaFX.Figure 2. Indeed Job Trends - Flex vs. Silverlight (Q1 2012) Figure 3. Indeed Job Trends – Java (Q1 2012)© blue-infinity, proprietary and confidential page 4 of 20
  • White Paper JavaFX3. Architecture3.1 BackgroundJavaFX 2 is a revolution of the JavaFX 1.x version. The JavaFX Script API has been remodeled andrebuilt using Java. The JavaFX Script API has been converted to pure Java. The main architecturaldesign goals were: Use the richness of Java like modern concurrency, properties and bindings, CSSsupport separates style and logic, etc. 3.1.1 Architectural OverviewFigure 4. Architectural block diagram showing the complete module stack of JavaFX 2.0.This diagram shows the JavaFX component stack.  The top layer represents the JavaFX public APIs and the JavaFX Scene Graph.  The next layer is the Quantum Toolkit which ties Prism and Glass Windowing Toolkit together and makes them available to the JavaFX layer.  The third layer: - Prism, processes render jobs - Glass Windowing Toolkit, provide native operating services (windows, timers, surfaces) - Media Engine, supports both visual and audio media - Web Engine, provides a web viewer and full browsing functionality (WebKit-based)  The fourth layer consists of the Java 2D, OpenGL, and D3D, graphics rendering servicesThe Quantum Toolkit, Prism, Java 2D, OpenGL, and D3D, make up the JavaFX Graphics System.The lowest layer is the Java Virtual Machine which sits underneath the JavaFX Graphics System, GlassWindowing Toolkit, Media Engine, and the Web Engine. 3.1.2 UI Design ArchitectureThe JavaFX scene graph, shown as part of the top layer in figure 4, is the starting point forconstructing a JavaFX application. A single element in a scene graph is called a node. Each node has anID, style class, and bounding volume. Each node in a scene graph has a single parent and zero or morechildren. It can also have the following:  Effects, such as blurs and shadows© blue-infinity, proprietary and confidential page 5 of 20
  • White Paper JavaFX  Opacity  Transforms  Event handlers (such as mouse, key and input method)  An application-specific stateThe javafx.scene API allows the creation and specification of several types of content, such as:  Nodes: Shapes (2-D and 3-D), images, media, embedded web browser, text, UI controls, charts, groups, and containers  State: Transforms (positioning and orientation of nodes), visual effects, and other visual state of the content  Animation: Varying properties of the scene graph objects over time  Effects: Simple objects that change the appearance of scene graph nodes, such as blurs, shadows, and color adjustmentTour de JavaFX - EnsembleOracle has provided an equivalent of Adobe Flex showcase “Tour de Flex”. It is named Ensemble and isfound at the following address (To run it, you must have the JavaFX Runtime installed):http://download.oracle.com/otndocs/products/javafx/2.0.2/samples/Ensemble/index.htmlFigure 5. JavaFX showcase application Ensemble. 3.1.3 Java APIs for JavaFX FeaturesThese new Java APIs for JavaFX features allow the use of powerful Java features, such as generics,annotations, and multithreading.© blue-infinity, proprietary and confidential page 6 of 20
  • White Paper JavaFXOne of the most powerful features of the API is the use of bindings, similar to that in JavaFX 1.x Scriptlanguage. This includes support for high performance lazy binding, binding expressions, boundsequence expressions, and partial bind re-evaluation.It also allows extending of the Java collections library to include observable lists and maps, which allowapplications to wire user interfaces to data models, observe changes in those data models, and updatethe corresponding UI control accordingly.3.2 Hardware and Software Compatibility 3.2.1 Operating Systems – Windows, OS X, GNU/Linux, iOS, AndroidJavaFX has a multilayer architecture that has been designed with portability in mind. The Internal APIis a course-grained porting layer. The JavaFX APIs is isolated from implementation details. This allowsporting to completely different systems (Operation Systems/Architectures).JavaFX does run on devices like iOS and Android using exactly the same application code and exactlythe same JavaFX layer are used for the iOS version. But it is using an iOS specific implementation ofthe abstraction layer Glass.The Windowing API, Glass, runs (or will run) on the following systems Windows (Win 32), Mac (Cocoa),GNU/Linux (GTK) and Headless. 3.2.2 Dynamic Languages for JavaFX – Groovy, Scala, ClojureThe JavaFX API enables dynamic languages to use JavaFX. By extension these languages support fullinteroperability with Java and can run anywhere the Java Virtual Machine (JVM) and JavaFX aresupported. Hence, you can use scripting languages that produce bytecode compatible with the JVM,such as Groovy, Scala or Clojure, if you prefer to use a declarative language.Scala is a general purpose programming language designed to express common programming patternsin a concise, elegant, and type-safe way.Groovy is an optionally typed, dynamic language for the Java platform with many features that areinspired by languages like Python, Ruby, and Smalltalk, making them available to Java developersusing a Java-like syntax.Clojure (http://clojure.org) is a dynamic programming language that targets the Java Virtual Machine(and the CLR, and JavaScript). It is designed to be a general-purpose language, combining theapproachability and interactive development of a scripting language with an efficient and robustinfrastructure for multithreaded programming. 3.2.2.1 GroovyFX / ScalaFXGroovyFX (http://groovy.codehaus.org/GroovyFX) is an API that simplifies working with JavaFX usingGroovy. It enables a much simpler and more natural way to use JavaFX for those well-versed inGroovy. GroovyFX is focused on leveraging the Builder pattern for JavaFX applications, and it leveragessome of the capabilities that Groovy provides and makes the Groovy based JavaFX code easier towrite.© blue-infinity, proprietary and confidential page 7 of 20
  • White Paper JavaFXScalaFX (http://www.scalafx.org) is an abstraction layer on top of JavaFX written with Scala that sitson top of JavaFX. This means that every ScalaFX application is also a valid Scala application. 3.2.3 Support for other platformsOracle is investing time and resources to get Java to run on other hardware platforms than Intel™.They have released the Java SE JDK for Embedded on ARM™ and x86 platforms. This is driven by theexplosion of smartphone and other modern devices.The release of JavaFX version 2.0.2 introduced interoperability with the Standard Widget Toolkit(SWT). This extends the possibilities to use JavaFX in either Swing or SWT applications.3.3 Comparison ChartSince Microsoft will cease supporting plugins in Internet Explorer 10 (Sinofsky, Blog post Q3 2011),this incurs that Silverlight™ is not a viable option in the future. Hence, presented below is acomparison between the two open source frameworks Adobe Flex™ and JavaFX.Category Adobe Flex™ JavaFXMaturity Very mature, v1.0 released 2004 Immature, v2.0 Released Q4 2011Language MXML for its declarative aspects, FXML for its declarative aspects, ActionScript for the programmatic Java for the programmatic aspects aspectsControls & 50+ 50+Components + many other components, both open- + increasing amount of open- source and commercial source componentsDeep Linking Yes NoCharts Yes YesBrowser Back/Forward Yes NoData Binding Yes Yes2D, 3D Effects Yes, with Flash 10+ YesAnimations, Yes YesTransformations& EffectsCSS Styling Yes Yes, CSS 2.1GPU Hardware Yes, with Flash 10+ Yes, since 2.0AccelerationHD Video Yes, with H.264. Also support for true Yes, but not H.264. FLV containing HD video (1080p) VP6 video and MP3 audioLocalization Yes YesJavaScript Yes, both ways Yes, both waysInteractionMulti-threading No Yes, utilizing Java’s threading capabilities© blue-infinity, proprietary and confidential page 8 of 20
  • White Paper JavaFXTooling – Development FlexBuilder IDE is mature Focus on developers, i.e. NetBeans, Eclipse, IntelliJ, etc.Tooling – UI Designer Since 2006, but not very good None, scheduled in mid-2012Runtime Availability Ubiquitous, but unavailable on iOS JavaFX bundled with JRE and available on iOS 96% of all browsers 75% of all browsersDeveloper Community Very active developer community Active developer communityGovernance Spoon project started by Adobe will OpenJFX started by Oracle will in govern the development of the Flex due time “own” the JavaFX code Framework. base.License Free Adobe Flex SDK: Adobe Flex SDK OpenJFX releases: license GPL v2 with Classpath Exception license (1991) Open Source Flex SDK: open-source (Mozilla JavaFX: Java Binary Code License Public License 1.1) (Q4 2011) Adobe Flash Player: Proprietary freeware EULA Adobe Flash Builder: Proprietary EULA Adobe Catalyst: Proprietary EULATable 1. Comparison between technical and non-technical characteristics of Adobe Flex™ and JavaFX.© blue-infinity, proprietary and confidential page 9 of 20
  • White Paper JavaFX 3.3.1 Third Party Frameworks and LibrariesThe worldwide Java community has gathered and built a vast knowledge and structure capital duringthe lifetime of Java. All current and future Java frameworks and libraries are available to the JavaFXdeveloper. There are also third party frameworks and libraries available to extend and supplement thebasic JavaFX API.The JavaFX community is growing and every week there is new components available to use. Thefollowing sub-sections cover some of the community-provided (third party) JavaFX frameworks andlibraries available at the time of writing. GroovyFX and ScalaFX have already been mentioned above. 3.3.1.1 JRebirthJRebirth (http://www.jrebirth.org) is a JavaFX framework that simplifies writing powerful RIAsapplications. It is a WCS-MVC pattern with 6 main layers: Application: The Application is the starting class to extend to build a JavaFX application that use JRebirth framework. GlobalFacade: The GlobalFacade is used to simplify access to the other layers. CommandFacade and Commands: The Command layer is used to manage complex group of actions (MultiCommand) (synchronously or asynchronously), or atomic reusable action (Command). All interactions between layers must be managed by Commands. ServiceFacade and Services: The Service layer is used to retrieve Data from outside the application or to communicate with others applications. Figure 6. JRebirth Framework diagram. UiFacade and Models: The Model layer is used to manage the loading of the data displayed into a view, for example by calling a service. Controllers: A Controller manages the Views Interactions logic. Its used to intercept all JavaFX components events. Views: The view layer is used to create user interface by using JavaFX core components.© blue-infinity, proprietary and confidential page 10 of 20
  • White Paper JavaFX 3.3.1.2 MigLayoutFXMigLayoutFX2 (formerly called MigPane, http://www.miglayout.com) is a wrapper for MigLayout, one ofthe most powerful layout managers for Swing. This wrapper allows you to use the power of MigLayoutto layout nodes in JavaFX.Figure 7. Picture showing a MigLayout simple layout example code. 3.3.1.3 JFX FlowJFX Flow (http://www.zenjava.com/jfx-flow) is a free, open source framework for developing rich,interactive and user friendly web-style GUIs for desktops using JavaFX (2.0+). JFX Flow combines thepowerful feature set of Java FX (styling, animations, FXML, etc.) with a simple ‘web flow’ styleframework, that is easy to use and that fosters clean architectural patterns, especially when developingJEE applications.  Supports simple, user friendly “web-style” user interface design  Provides built-in navigation support for browser-like applications (back, forward, refresh, etc)  Facilitates a modularized application architecture of reusable components with clean separation of concerns (i.e. separate view code from control code)  Provides integration with JEE technologies, such as Spring, Guice, databases and web services.  Provides a toolkit for common user interface tasks such as blocking while loading, error handling, animated page transitions and more. 3.3.1.4 DataFXIn summary, the DataFX (http://www.javafxdata.org) project aims to make the process of usingJavaFX ListView, TableView, and TreeView controls easier, more functional, and more powerful. Itprovides various data source adapters to ensure convenience around populating JavaFX controls. 3.3.1.5 RedFXRedFX (http://www.redfx.org) provides functionality that allows JavaFX applications to share data witheach other and with server applications without the need of writing lots of specific boiler plate code.The synchronization and messaging infrastructure is provided by RedFX. The code was originallywritten for JavaFX 1.3.1 but has been ported to JavaFX 2. 1. use RemoteObjects in order to synchronize data between JavaFX clients or between clients and a server application. 2. use the MessageService to publish and consume Objects and events. Both clients as well as server software can create a Channel and publish/consume data. 3. use the WebServiceClient in order to make REST calls to existing back-end systems.© blue-infinity, proprietary and confidential page 11 of 20
  • White Paper JavaFX4. Development4.1 Development EnvironmentsTo start developing JavaFX, you need to install the JavaFX SDK, either standalone or bundled with thelatest Java SE Development Kit version 7 update 2 (Windows). Future releases of JavaFX will besynchronized with the releases of Java SE Development kit. 4.1.1 JavaFX IDE SupportJavaFX is based on the Java language. Developers can thereby use their favorite Java developmenttools, such as the NetBeans and Eclipse, for development of JavaFX applications. All the standard IDEfeatures, including syntax highlighting, auto-completion, interactive step-through debugging, andprofiling are available for JavaFX developers. This is a major benefit and lowers the entry level fordevelopers new to JavaFX. 4.1.1.1 NetBeansNetBeans 7.1 supports full compile, debug and profile development cycle for JavaFX applications.However, NetBeans does not provide code completion for the FXML file format. But evidently, CodeCompletion for the Java/JavaFX code of course available out-of-the-box. 4.1.1.2 EclipseEclipse provides the same support for JavaFX and more by using a third party plugin called e(fx)clipse(http://efxclipse.org). e(fx)clipse extends the Eclipse IDE and provides in fact its own variant of codecompletion for FXML, hereby circumventing the lack of DTD/ XSD Schema for FXML. The pluginintegrates with JDT (e.g. JavaDoc for referenced elements, auto completion support, etc.).4.2 Visual Design DevelopmentThe current Oracle JavaFX suite of tools does not offer an application for WYSIWYG development of theuser interface. The implementation of a user interface designer in NetBeans named Composer iscurrently being redeveloped to be able to handle JavaFX in the future. Oracle are developing anapplication named JavaFX Scene Builder, and has declared the General Availability release in mid-2012. Currently Oracle previews a non-public beta version of the application. It is available byinvitation only.The separation of application logic and presentation is based on the FXML. FXML is an XML-baseddeclarative markup language for defining the user interface in a JavaFX application.© blue-infinity, proprietary and confidential page 12 of 20
  • White Paper JavaFXThe following section outlines some of the JavaFX Scene Builder Features and an early screenshot ofthe application:  Simple drag and drop positioning of GUI elements  Graphical FXML editor  Strong mapping to JavaFX APIs  Set and preview JavaFX properties and effects  CSS setting and previewing  Fully written with JavaFX version 2.0 APIs!Figure 8. Screenshot of the Beta version of the Scene Builder application built with JavaFX. 4.2.2 UI Design Capabilities 4.2.2.1 Designer – Developer WorkflowJavaFX allows designers and developers to work on rich Internet applications (RIAs) concurrently. Hereis an example of an iterative designer-developer workflow. 1. Designers and developers meet to draw a graphic prototype and agree on the graphic objects and their names. This step is very important, because it ensures that the designer can drop the graphic into the application when it is ready without causing rework. 2. The designers create the graphic content using their design tools, while the developers create the business logic of the application, using the rough sketch as a placeholder and the graphic object names for their object IDs. 3. The content design and business logic go through as many iterations as necessary. 4. When both the content and business logic of the JavaFX application is final, it is deployed.With JavaFX it is possible to map Adobe Photoshop™ elements to JavaFX code. And by using AdobeIllustrator™ you can create vector based graphics (SVG) and copy paths directly into the JavaFX code.© blue-infinity, proprietary and confidential page 13 of 20
  • White Paper JavaFX 4.2.2.2 CSS CapabilitiesJavaFX enables the use of Cascading Style Sheets (CSS) which provides the ability to apply customizedstyling to the user interface of a JavaFX application without changing any of that applications sourcecode. CSS can be applied to any node in the JavaFX scene graph and are applied to the nodesasynchronously. CSS styles can also be easily assigned to the scene at runtime, allowing anapplications appearance to dynamically change.JavaFX CSS is based on the W3C CSS version 2.1 specifications, with some additional functions fromcurrent work on CSS version 3.In combination with FXML, using CSS further separates the application logic from the visual style.Figure 9. Screenshot of an example application showing the CSS capabilities of JavaFX© blue-infinity, proprietary and confidential page 14 of 20
  • White Paper JavaFX4.3 Testing 4.3.1 Unit Testing the UI ModelThere are no official UI test tools available. Oracle is leaning on the Java/JavaFX community to supplythese tools.It is possible, by using JavaScript, to reference Java code in the JavaFX object. In other words, it ispossible to use JavaScript to retrieve references to Java objects. You can access static fields or invokestatic methods for classes loaded by a given JavaFX application. This enables Selenium UI tests. Alltests of the JavaFX UI framework must be done by executing JavaScript calls to the JavaFX object.There is a third party UI test tool called SmartBear loadUI (SmartBear acquired eviware software in2011). But it is only possible to test JavaFX 1.3.x. 4.3.2 FXML Dependency InjectionAt the moment there is no way to Dependency Inject components specified in the FXML file, whichimpair the test fixture setup. The FXML specifies the concrete implementation of the controller classesand not their interfaces or abstract classes. Hence with JavaFX version 2.0.2, it is not possible to usethe Dependency Injection pattern in the development and testing of the application.The JavaFX team is currently working on a solution according to the following bug, http://javafx-jira.kenai.com/browse/RT-14880.4.4 Best Practices 4.4.3 Patterns and ArchitectureThe usual software design patterns also applies to JavaFX. But there are also other aspects affecting auser interface application. Martin Fowler has touched upon this subject in the following post:http://martinfowler.com/eaaDev/uiArchs.htmlIn the official Oracle JavaFX forum, JavaFX team members point to the JFX Flow project as a referencefor best practices when developing a JavaFX application.© blue-infinity, proprietary and confidential page 15 of 20
  • White Paper JavaFX4.5 DeploymentSince JavaFX adheres to the Java standard, applications can be deployed on a desktop or in a browserin four different deployment modes:  Standalone: The JavaFX application is installed on a local drive and is run by double- clicking the JAR file (or multiple jar files for large applications). This mode is ideal when users do not need or do not have online access.  Browser: In this mode, the JavaFX application is embedded in a web page and is started automatically when the web page is accessed. It can interact with the web page through JavaScript.  WebStart: This mode downloads the application from a central location on the web and then runs it on the desktop. Once it is downloaded, users can start the application by double-clicking the JNLP file.  Launched from a desktop shortcut: Users can create a desktop shortcut for a remote Web Start or embedded application to simplify its subsequent launch.4.6 Continuous Integration Support 4.6.1 Build ToolsYou may develop JavaFX with your favorite Java IDE and even on the command line. To build, packageand release your application, there is support for Ant (out-of-the-box) and Maven (third party). 4.6.1.1 Ant SupportThe JavaFX SDK includes Ant tasks that enable the assembling and packaging the JavaFX binariesaccording to the deployment strategy chosen. As previously, it is possible to sign the jar files forincreased security.  Creating one or more JAR files  Creating an HTML page and deployment descriptor for Web Start applications or applications embedded in a web page  Digitally signing an application, when necessary  Converting CSS files to binary format 4.6.1.2 Maven SupportAs of now, there is no official support for building JavaFX projects with Maven. There are workaroundsbut the main obstacle is that the JavaFX runtime relies on a DLL file (for Win32), i.e. you must first© blue-infinity, proprietary and confidential page 16 of 20
  • White Paper JavaFXinstall runtime binaries. You must add the runtime jar files to your local maven repository or yourrepository manager of choice, e.g. Archiva, Nexus etc.At the moment JavaFX core contains proprietary components that prohibit the distribution of theruntime using maven repositories.As mentioned above, there are no Maven plugins for JavaFX. However, using the maven-ant-plugin it ispossible for Maven to execute the Ant tasks. 4.6.2 Sonar RulesContinuous Integration provides the means to increase code quality in general. Using Sonar addsmeasuring of code metrics and validation of best practices. There are best practices for developingJavaFX applications. However, these have not yet been “officially” translated to Sonar rules. Thecommunity provides information and even makes available Sonar rule sets. Since JavaFX is Java, theusual Java rules apply to the JavaFX specific code.The following rules sets are used to validate the JRebirth Framework:http://blog.webeo.fr/public/Sonar/rules-active.csvhttp://blog.webeo.fr/public/Sonar/rules-inactive.csv 4.6.3 Performance TestsA repeat of the already stated fact, JavaFX is Java. This is just another java application which meansthat you may reuse and/or create new unit performance tests that are executed in the build phase.This leverages your previous investments even further.© blue-infinity, proprietary and confidential page 17 of 20
  • White Paper JavaFX5. Road MapAt JavaOne 2010, Oracle laid out a long-term roadmap for JavaFX to make it a premier rich clientplatform. JavaFX version 2.0 is a significant milestone towards fulfilling this vision.Figure 10. Diagram showing the roadmap of the JavaFX product line.Open SourceOracle released JavaFX version 2.0 at JavaOne 2011 and made an announcement of its open sourcestatus. Oracle want JavaFX to be open sourced under a “GNU General Public License, version 2, withthe Classpath Exception” (1991), similar to other projects in the OpenJDK Community.Tighter Integration with Java SE (OpenJDK)JavaFX will be tightly integrated as part of JDK 8 platform that will see an integration of JavaFX in theOpenJDK, thus ensuring widespread adoption, synchronized updates and security fixes. JavaFX SDKand runtime is bundled with the release of Java SE 7 update 2 (for Windows).JavaFX 3 in JDK 8Furthermore, delivering on the cross platform promise, JavaFX will become available simultaneouslyacross Windows, Mac, and Linux implementations of Java SE 8, allowing cross platform deployment ofapplications as soon as the product becomes generally available.Oracle intends to file a JSR in the Java SE 9 time frame to make it a Java standard.Advanced toolingJavaFX Scene Builder is a WYSIWYG GUI design tool for the JavaFX platform. It enables designing userinterface screens by simply dragging and positioning GUI components from a palette onto a scene. Thetool generates files in FXML format2 that can be used within a project in any IDE such as NetBeans orEclipse. The JavaFX Scene Builder can be used to create GUIs for desktop applications and applets thatrun in a browser.Planned FeaturesAccording to the official roadmap will JavaFX provide support for modern device interaction (e.g.chipsets ARM, MIPS and multi-touch screens).Modularization is one of the key features of Java SE 8. JavaFX will adhere to this and will bemodularized to completely leverage the benefits provided by the modularized Java SE 8.© blue-infinity, proprietary and confidential page 18 of 20
  • White Paper JavaFX6. ConclusionWhile Flex and Silverlight are compared in the RIA white paper published in June 2009 by the marketresearch company Gartner, JavaFX 1.x is not even mentioned (Knipp & Valdes, 2009). Fast-forward to2011, and Oracle introduces JavaFX version 2.0. This reboot of JavaFX 1.x have yet to be fully digestedby the Java community and by companies.Even though JavaFX is missing UI Design tool, this will not hinder the continued adoption of JavaFXsince most applications are more or less developed without using such a tool. JavaFX still lags incertain areas compared to other plugin-based frameworks, but Oracle is outlining an aggressiveroadmap for the near future.The unique selling point is the fact that JavaFX leans on the enterprise proven Java language.JavaFX has more stable components and a greater selection than previously, it is a good alternative forJava developers when developing front-ends to stand-alone applications. JavaFX will find a use casewithin applications aimed to a limited group of users, in intranets or environments that are identicaland configured centrally, in order to work more seamlessly.The relatively sparse usage of JavaFX, as compared to the other frameworks, is confirmed by lookingat the current market. There are barely any results on job search websites, and not much informationto be found about it neither online nor on forums.But JavaFX eco-system is evolving very fast; more and more articles are published and are find theirway onto the internet.JavaFX will soon be the only company backed plugin-based UI framework that is aiming for theenterprise market.© blue-infinity, proprietary and confidential page 19 of 20
  • White Paper JavaFX7. ReferencesGoogle Insights for Search, Beta (Q1 2012)http://www.google.com/insights/search/#q=javafx%20%2B%20java%20fx%20%2B%20%22java%20fx%22%2Cflex%20%2B%20adobe%20flex%20%2B%20%22adobe%20flex%22%2Csilverlight%20%2B%20microsoft%20silverlight%20%2B%20%22microsoft%20silverlight%22&cmpt=qTIOBE Programming Community Index (Q1 2012)http://www.tiobe.com/index.php/content/paperinfo/tpci/index.htmlForrester report on RIA (Q4 2010)http://www.forrester.com/rb/Research/rich_internet_applications_will_power_online_experiences/q/id/47919/t/2Oracle Press Release - Oracle Increases Investment in JavaFX and Outlines Product Roadmap (Q3 2010)http://www.oracle.com/us/corporate/press/173728Indeed Adobe Flash™, Flex™ and Microsoft Silverlight™ Job Trend (Q1 2012)http://www.indeed.com/trendgraph/jobgraph.png?q=%28%22adobe+flex%22+or+%22adobe+flash%22+or+actionscript%29%2C+silverlightIndeed Java Job Trend (Q1 2012)http://www.indeed.com/trendgraph/jobgraph.png?q=javaSteven Sinofsky, Blog post (Q3 2011)http://blogs.msdn.com/b/b8/archive/2011/09/14/metro-style-browsing-and-plug-in-free-html5.aspxGNU General Public License, version 2, with the Classpath Exception (Q2 1991)http://openjdk.java.net/legal/gplv2+ce.htmlOracle Binary Code License Agreement for the Java SE Platform Products and JavaFX (Q4 2011)http://www.oracle.com/technetwork/java/javase/terms/license/index.htmlKnipp, Eric. Valdes, Ray. (2009). Navigating the Ajax vs. Heavy RIA Dilemma. Gartner, Inc.Moritz, Florian. (2008). Rich Internet Applications (RIA): A Convergence of User Interface Paradigms of Web andDesktopExemplified by JavaFX. Diploma Thesis, University of Applied Science Kaiserslautern, Germany. Available:http://www.flomedia.de/diploma/documents/DiplomaThesisFlorianMoritz.pdfRich Internet Applications (RIAs) – A Comparison Between Adobe Flex, JavaFX and Microsoft Silverlight (2009)http://publications.lib.chalmers.se/records/fulltext/116839.pdfGENERAL REFERENCESOracle JavaFX homepage: http://www.oracle.com/javafxOpenJDK OpenJFX homepage: http://openjdk.java.net/projects/openjfxSelection of Third Party Frameworks and Librarieshttp://www.javafxdata.org http://www.jrebirth.org http://www.redfx.orghttp://www.miglayout.com http://java.net/projects/miglayoutfx2 http://www.zenjava.com/jfx-flow© blue-infinity, proprietary and confidential page 20 of 20