Bi White Paper Javafx 120217052434 Phpapp02

Embed Size (px)

Citation preview

  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    1/20

    White Paper JavaFX 2

    blue infinity

    Version: 1.0 RC2

    Date: 10.01.2012

    Submitted to:

    Author: Jan StenvallSbastien Vandenbergh (supervisor)

    Contact:

  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    2/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 2 of 20

    Table of Contents

    1. Introduction ............................................................................................................... 3

    2. Business Analysis ....................................................................................................... 4

    3. Architecture ............................................................................................................... 5 3.1 Background .............................................................................................................. 5 3.1.1 Architectural Overview ........................................................................................... 5 3.1.2 UI Design Architecture ........................................................................................... 5 3.1.3 Java APIs for JavaFX Features ................................................................................. 6 3.2 Hardware and Software Compatibility .......................................................................... 7 3.2.1 Operating Systems Windows, OS X, GNU/Linux, iOS, Android .................................. 7 3.2.2 Dynamic Languages for JavaFX Groovy, Scala, Clojure ............................................ 7 3.2.2.1 GroovyFX / ScalaFX ............................................................................................... 7 3.2.3 Support for other platforms .................................................................................... 8

    3.3 Comparison Chart ..................................................................................................... 8 3.3.1 Third Party Frameworks and Libraries .................................................................... 10 3.3.1.1 JRebirth ............................................................................................................. 10 3.3.1.2 MigLayoutFX ....................................................................................................... 11 3.3.1.3 JFX Flow ............................................................................................................. 11 3.3.1.4 DataFX ............................................................................................................... 11 3.3.1.5 RedFX ................................................................................................................ 11

    4. Development ............................................................................................................ 12 4.1 Development Environments ..................................................................................... 12 4.1.1 JavaFX IDE Support ............................................................................................. 12

    4.1.1.1 NetBeans ........................................................................................................... 12 4.1.1.2 Eclipse ............................................................................................................... 12 4.2 Visual Design Development ...................................................................................... 12 4.2.2 UI Design Capabilities .......................................................................................... 13 4.2.2.1 Designer Developer Workflow ............................................................................. 13 4.2.2.2 CSS Capabilities .................................................................................................. 14 4.3 Testing .................................................................................................................. 15 4.3.1 Unit Testing the UI Model ..................................................................................... 15 4.3.2 FXML Dependency Injection .................................................................................. 15 4.4 Best Practices ......................................................................................................... 15 4.4.3 Patterns and Architecture ..................................................................................... 15 4.5 Deployment ........................................................................................................... 16 4.6 Continuous Integration Support ................................................................................ 16 4.6.1 Build Tools.......................................................................................................... 16 4.6.1.1 Ant Support ........................................................................................................ 16 4.6.1.2 Maven Support .................................................................................................... 16 4.6.2 Sonar Rules ........................................................................................................ 17 4.6.3 Performance Tests ............................................................................................... 17

    5. Road Map.................................................................................................................. 18

    6. Conclusion ................................................................................................................ 19

    7. References ............................................................................................................... 20

  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    3/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 3 of 20

    1. Introduction

    BackgroundThis 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 for

    more 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.

  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    4/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 4 of 20

    2. Business Analysis

    Rich 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 the java 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)

  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    5/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 5 of 20

    3. Architecture

    3.1 Background

    JavaFX 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 Overview

    Figure 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 services

    The 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 Architecture

    The 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

  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    6/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 6 of 20

    Opacity Transforms Event handlers (such as mouse, key and input method) An application-specific state

    The 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 adjustment

    Tour 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.html

    Figure 5. JavaFX showcase application Ensemble.

    3.1.3 Java APIs for JavaFX Features

    These new Java APIs for JavaFX features allow the use of powerful Java features, such as generics,annotations, and multithreading.

    http://download.oracle.com/otndocs/products/javafx/2.0.2/samples/Ensemble/index.htmlhttp://download.oracle.com/otndocs/products/javafx/2.0.2/samples/Ensemble/index.htmlhttp://download.oracle.com/otndocs/products/javafx/2.0.2/samples/Ensemble/index.html
  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    7/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 7 of 20

    One 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, Android

    JavaFX 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 of the 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, Clojure

    The 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 / ScalaFX

    GroovyFX (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.

    http://clojure.org/http://clojure.org/http://clojure.org/http://groovy.codehaus.org/GroovyFXhttp://groovy.codehaus.org/GroovyFXhttp://groovy.codehaus.org/GroovyFXhttp://groovy.codehaus.org/GroovyFXhttp://clojure.org/
  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    8/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 8 of 20

    ScalaFX (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 platforms

    Oracle 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 Chart

    Since 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 JavaFX

    Maturity Very mature, v1.0 released 2004 Immature, v2.0 Released Q4 2011

    Language MXML for its declarative aspects,ActionScript for the programmaticaspects

    FXML for its declarative aspects,Java for the programmatic aspects

    Controls &

    Components

    50+

    + many other components, both open-source and commercial

    50+

    + increasing amount of open-source components

    Deep Linking Yes No

    Charts Yes Yes

    Browser Back/Forward Yes No

    Data Binding Yes Yes

    2D, 3D Effects Yes, with Flash 10+ Yes

    Animations,

    Transformations& Effects

    Yes Yes

    CSS Styling Yes Yes, CSS 2.1

    GPU HardwareAcceleration

    Yes, with Flash 10+ Yes, since 2.0

    HD Video Yes, with H.264. Also support for trueHD video (1080p)

    Yes, but not H.264. FLV containingVP6 video and MP3 audio

    Localization Yes Yes

    JavaScriptInteraction

    Yes, both ways Yes, both ways

    Multi-threading No Yes, utilizing Javas thread ingcapabilities

    http://www.scalafx.org/http://www.scalafx.org/http://www.scalafx.org/http://www.scalafx.org/
  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    9/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 9 of 20

    Tooling 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-2012

    Runtime Availability Ubiquitous, but unavailable on iOS

    96% of all browsers

    JavaFX bundled with JRE andavailable on iOS

    75% of all browsers

    Developer Community Very active developer community Active developer community

    Governance Spoon project started by Adobe willgovern the development of the FlexFramework.

    OpenJFX started by Oracle will indue time own the JavaFX codebase.

    License Free Adobe Flex SDK: Adobe Flex SDKlicense

    Open Source Flex SDK: open-source(MozillaPublic License 1.1)

    Adobe Flash Player:Proprietary freeware EULA

    Adobe Flash Builder:Proprietary EULA

    Adobe Catalyst:Proprietary EULA

    OpenJFX releases:GPL v2 with Classpath Exceptionlicense (1991)

    JavaFX: Java Binary Code License(Q4 2011)

    Table 1. Comparison between technical and non-technical characteristics of Adobe Flex and JavaFX.

  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    10/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 10 of 20

    3.3.1 Third Party Frameworks and Libraries

    The 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 JRebirth

    JRebirth (http://www.jrebirth.org ) is a JavaFX framework that simplifies writing powerful RIA'sapplications. It is a WCS-MVC pattern with 6 main layers:

    Application : The Application is the startingclass to extend to build a JavaFX applicationthat use JRebirth framework.

    GlobalFacade : The GlobalFacade is used tosimplify access to the other layers.

    CommandFacade and Commands : TheCommand layer is used to manage complexgroup of actions (MultiCommand)(synchronously or asynchronously), or atomic

    reusable action (Command).All interactions between layers must bemanaged by Commands.

    ServiceFacade and Services : The Servicelayer is used to retrieve Data from outside theapplication or to communicate with othersapplications.

    UiFacade and Models : The Model layer isused to manage the loading of the datadisplayed into a view, for example by calling aservice.

    Controllers : A Controller manages the View'sInteractions logic. It's used to intercept allJavaFX components' events.

    Views : The view layer is used to create userinterface by using JavaFX core components.

    Figure 6. JRebirth Framework diagram.

    http://www.jrebirth.org/http://www.jrebirth.org/http://www.jrebirth.org/http://www.jrebirth.org/
  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    11/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 11 of 20

    3.3.1.2 MigLayoutFX

    MigLayoutFX2 (formerly called MigPane, http://www.miglayout.com ) is a wrapper for MigLayout, one of the 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 Flow

    JFX 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 DataFX

    In 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 RedFX

    RedFX (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 clientsand a server application.

    2. use the MessageService to publish and consume Objects and events. Both clients as wellas 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.

    http://www.miglayout.com/http://www.miglayout.com/http://www.miglayout.com/http://www.zenjava.com/jfx-flowhttp://www.zenjava.com/jfx-flowhttp://www.zenjava.com/jfx-flowhttp://www.javafxdata.org/http://www.javafxdata.org/http://www.javafxdata.org/http://www.redfx.org/http://www.redfx.org/http://www.redfx.org/http://www.redfx.org/http://www.javafxdata.org/http://www.zenjava.com/jfx-flowhttp://www.miglayout.com/
  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    12/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 12 of 20

    4. Development

    4.1 Development Environments

    To 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 Support

    JavaFX 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 NetBeans

    NetBeans 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 Eclipse

    Eclipse 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 Development

    The 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.

    http://efxclipse.org/http://efxclipse.org/
  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    13/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 13 of 20

    The following section outlines some of the JavaFX Scene Builder Features and an early screenshot of the 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 Workflow

    JavaFX 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 graphicobjects and their names. This step is very important, because it ensures that the designercan 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 developerscreate the business logic of the application, using the rough sketch as a placeholder andthe 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 Adobe

    Illustrator you can create vector based graphics (SVG) and copy paths directly into the JavaFX code.

  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    14/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 14 of 20

    4.2.2.2 CSS Capabilities

    JavaFX 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 application's 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 anapplication's 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

  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    15/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 15 of 20

    4.3 Testing

    4.3.1 Unit Testing the UI Model

    There 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 Injection

    At 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 Architecture

    The 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.html In the official Oracle JavaFX forum, JavaFX team members point to the JFX Flow project as a referencefor best practices when developing a JavaFX application.

    http://javafx-jira.kenai.com/browse/RT-14880http://javafx-jira.kenai.com/browse/RT-14880http://javafx-jira.kenai.com/browse/RT-14880http://martinfowler.com/eaaDev/uiArchs.htmlhttp://martinfowler.com/eaaDev/uiArchs.htmlhttp://martinfowler.com/eaaDev/uiArchs.htmlhttp://javafx-jira.kenai.com/browse/RT-14880http://javafx-jira.kenai.com/browse/RT-14880
  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    16/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 16 of 20

    4.5 Deployment

    Since JavaFX adheres to the Java standard, applications can be deployed on a desktop or in a browser

    in 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 whenusers do not need or do not have online access.

    Browser : In this mode, the JavaFX application is embedded in a web page and is startedautomatically when the web page is accessed. It can interact with the web page throughJavaScript.

    WebStart : This mode downloads the application from a central location on the web andthen runs it on the desktop. Once it is downloaded, users can start the application bydouble-clicking the JNLP file.

    Launched from a desktop shortcut : Users can create a desktop shortcut for a remoteWeb Start or embedded application to simplify its subsequent launch.

    4.6 Continuous Integration Support

    4.6.1 Build Tools

    You 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 Support

    The 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 for

    increased 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 Support

    As 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

  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    17/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 17 of 20

    install 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 Rules

    Continuous 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.csv http://blog.webeo.fr/public/Sonar/rules-inactive.csv

    4.6.3 Performance Tests

    A repeat of the already stated fact, JavaFX is Java. This is just another java application which means

    that you may reuse and/or create new unit performance tests that are executed in the build phase.This leverages your previous investments even further.

    http://blog.webeo.fr/public/Sonar/rules-active.csvhttp://blog.webeo.fr/public/Sonar/rules-active.csvhttp://blog.webeo.fr/public/Sonar/rules-inactive.csvhttp://blog.webeo.fr/public/Sonar/rules-inactive.csvhttp://blog.webeo.fr/public/Sonar/rules-inactive.csvhttp://blog.webeo.fr/public/Sonar/rules-active.csv
  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    18/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 18 of 20

    5. Road Map

    At 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 of applications 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.

    http://www.javafx.com/http://www.javafx.com/
  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    19/20

    White Paper JavaFX

    blue-infinity, proprietary and confidential page 19 of 20

    6. Conclusion

    While 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.

  • 7/31/2019 Bi White Paper Javafx 120217052434 Phpapp02

    20/20

    White Paper JavaFX

    7. References

    Google 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=q

    TIOBE Programming Community Index (Q1 2012)http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

    Forrester report on RIA (Q4 2010)http://www.forrester.com/rb/Research/rich_internet_applications_will_power_online_experiences/q/id/47919/t/2

    Oracle Press Release - Oracle Increases Investment in JavaFX and Outlines Product Roadmap (Q3 2010)

    http://www.oracle.com/us/corporate/press/173728

    Indeed 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+silverlight

    Indeed Java Job Trend (Q1 2012)http://www.indeed.com/trendgraph/jobgraph.png?q=java

    Steven Sinofsky, Blog post (Q3 2011)http://blogs.msdn.com/b/b8/archive/2011/09/14/metro-style-browsing-and-plug-in-free-html5.aspx

    GNU General Public License, version 2, with the Classpath Exception (Q2 1991)http://openjdk.java.net/legal/gplv2+ce.html

    Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX (Q4 2011)http://www.oracle.com/technetwork/java/javase/terms/license/index.html

    Knipp, 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.pdf

    Rich Internet Applications (RIAs) A Comparison Between Adobe Flex, JavaFX and Microsoft Silverlight (2009)http://publications.lib.chalmers.se/records/fulltext/116839.pdf

    GENERAL REFERENCESOracle JavaFX homepage: http://www.oracle.com/javafx OpenJDK OpenJFX homepage: http://openjdk.java.net/projects/openjfx

    Selection of Third Party Frameworks and Librarieshttp://www.javafxdata.org http://www.jrebirth.org http://www.redfx.org http://www.miglayout.com http://java.net/projects/miglayoutfx2 http://www.zenjava.com/jfx-flow

    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=qhttp://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=qhttp://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=qhttp://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=qhttp://www.tiobe.com/index.php/content/paperinfo/tpci/index.htmlhttp://www.tiobe.com/index.php/content/paperinfo/tpci/index.htmlhttp://www.forrester.com/rb/Research/rich_internet_applications_will_power_online_experiences/q/id/47919/t/2http://www.forrester.com/rb/Research/rich_internet_applications_will_power_online_experiences/q/id/47919/t/2http://www.oracle.com/us/corporate/press/173728http://www.indeed.com/trendgraph/jobgraph.png?q=%28%22adobe+flex%22+or+%22adobe+flash%22+or+actionscript%29%2C+silverlighthttp://www.indeed.com/trendgraph/jobgraph.png?q=%28%22adobe+flex%22+or+%22adobe+flash%22+or+actionscript%29%2C+silverlighthttp://www.indeed.com/trendgraph/jobgraph.png?q=%28%22adobe+flex%22+or+%22adobe+flash%22+or+actionscript%29%2C+silverlighthttp://www.indeed.com/trendgraph/jobgraph.png?q=javahttp://www.indeed.com/trendgraph/jobgraph.png?q=javahttp://blogs.msdn.com/b/b8/archive/2011/09/14/metro-style-browsing-and-plug-in-free-html5.aspxhttp://blogs.msdn.com/b/b8/archive/2011/09/14/metro-style-browsing-and-plug-in-free-html5.aspxhttp://openjdk.java.net/legal/gplv2+ce.htmlhttp://openjdk.java.net/legal/gplv2+ce.htmlhttp://www.oracle.com/technetwork/java/javase/terms/license/index.htmlhttp://www.oracle.com/technetwork/java/javase/terms/license/index.htmlhttp://www.flomedia.de/diploma/documents/DiplomaThesisFlorianMoritz.pdfhttp://www.flomedia.de/diploma/documents/DiplomaThesisFlorianMoritz.pdfhttp://publications.lib.chalmers.se/records/fulltext/116839.pdfhttp://publications.lib.chalmers.se/records/fulltext/116839.pdfhttp://www.oracle.com/javafxhttp://www.oracle.com/javafxhttp://openjdk.java.net/projects/openjfxhttp://openjdk.java.net/projects/openjfxhttp://openjdk.java.net/projects/openjfxhttp://www.javafxdata.org/http://www.javafxdata.org/http://www.jrebirth.org/http://www.jrebirth.org/http://www.redfx.org/http://www.redfx.org/http://www.miglayout.com/http://www.miglayout.com/http://java.net/projects/miglayoutfx2http://java.net/projects/miglayoutfx2http://java.net/projects/miglayoutfx2http://www.miglayout.com/http://www.redfx.org/http://www.jrebirth.org/http://www.javafxdata.org/http://openjdk.java.net/projects/openjfxhttp://www.oracle.com/javafxhttp://publications.lib.chalmers.se/records/fulltext/116839.pdfhttp://www.flomedia.de/diploma/documents/DiplomaThesisFlorianMoritz.pdfhttp://www.oracle.com/technetwork/java/javase/terms/license/index.htmlhttp://openjdk.java.net/legal/gplv2+ce.htmlhttp://blogs.msdn.com/b/b8/archive/2011/09/14/metro-style-browsing-and-plug-in-free-html5.aspxhttp://www.indeed.com/trendgraph/jobgraph.png?q=javahttp://www.indeed.com/trendgraph/jobgraph.png?q=%28%22adobe+flex%22+or+%22adobe+flash%22+or+actionscript%29%2C+silverlighthttp://www.indeed.com/trendgraph/jobgraph.png?q=%28%22adobe+flex%22+or+%22adobe+flash%22+or+actionscript%29%2C+silverlighthttp://www.oracle.com/us/corporate/press/173728http://www.forrester.com/rb/Research/rich_internet_applications_will_power_online_experiences/q/id/47919/t/2http://www.tiobe.com/index.php/content/paperinfo/tpci/index.htmlhttp://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=qhttp://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=qhttp://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=q