How do I introduced JavaFX to a Japanese "SIer"?

This article is written as a part of "JavaFX Advent Calendar 2012", December 8th. The previous is "OpenJFXをコンンパイルしようとして挫折した記録" written by @kokuzawa.


I'll tell you what have I introduced JavaFX technology to a Japanese Systems Integrator that often called "SIer" with negagive image.

[NOTE] This topics has been a current project of our company. So I regret that I have to omit some part of it because of the security reason.

First, the position of JavaFX in Japan is "an advanced technology known by a few person". Generally, systems development in Japan use "old and proven technology" in many cases. Of cource that shall not use JavaFX. Even if we have enough informations aboud JavaFX and spare no effort to fight and using time, it is possible to change the situeation. In fact, I'm changing the situation in our team.

1. Prologue

I'm now well-known person in Japanese GlassFish communities, and vice president of GlassFish Users Group Japan. But my primary job is a programmer, called "Systems Engineer" in Japan, and I'd hired by an Systems Integrator in Tokyo. So, I work the "SIer" (a derogatory term means a Systems Integrator) that I often scorn for them on Twitter. Now I join a section that Its curtomer is a some offices in major bank, specially front and back offices exclude the systems division. We develop and maintenance softwares for end-user computing. Weekday, I work in the central office and spend many times on tweeting designing or programming softwares.

There are two types of systems using a bank. One of them are systems that the systems division of a bank makes the requirement specifications and ordered to one or many vendors. Most known example is the account system (it is huge and built spending thouthands man-months). Unfortunately, often they leaves all the decision-making to vendors. They are used a whole of a bank and important for the corporate strategy. Their scales are hundleds to thoutands man-months and the territory of mainframes and COBOL because of high-availability. In so far as open systems, there is increase of assignment of Java technology. But there is many people that like old technology as stable, because select not Java EE but Java EE 5 or J2EE 1.4 in 2012. And vendors usually use Struts or its based framework because they lack sufficient technical capacity. I worked some system development projects for a bank, but there are so terrible.

Otherwise is EUC (End User Computing) systems that ordered from the front/back-office without the systems division. The systems used in a bank are controlled by the systems division, but EUC systems is so small that the systems division is not control them. EUC systems are ordered to a vendor by front/back-office directly (If there is a person that acquires VBA or Notes, he/she may make). They are often small and unregarded reliability. But they are required quick delivery and running on the exist platforms such Excel or Access.

Our section is a specialists team in EUC systems of the bank. So we have many technical know-how about them. Until a few years ago, we are a division of the company and develop a lot of new systems. At that time there are consolidation of big banks in Japan, so numbers of systems are developed with the consolidation. Now we mainly maintenance the systems that developed around that time. Almost of them are developed by Access VBA because our customers require Access as target platform. As is well known, Access is a database for personal use and unconsidered multi-user access. Yet, they are forced adaptation for multi-user, so often database (MDB) is broken. In addition, the almost all customers are using Access 2003, but Access 2007 or later is restricted to develop VBA applications because of security reasons and new policy of Microsoft (they position Access as a front-end of SQL Server, SharePoint Server or Windows Azure). In future, even if our customers required a new system running on Access, we may be working out by technical reason. We have to be forecast these things, and considered alternative technology of Access VBA in 2011. Web system is most possible in some candicate technology. In fact, GlassFish that is my recommend is so agile and high-available that it will replaced almost all "legacy" Access VBA, we think. But we gave up the plan because JavaServer Faces is not rival Access as UI. Access. After the plan is expired, I had tried to propose modified plans but attract attention.

2. Java EE 6 is our way, JavaFX 2.0 is our hope!

Our company has remained in surplus in a few years. But our division has experience a drop in performance. There are many reasons but one of them the contructs of systems development in Japanese a peculiarly Japanese problem.

In Japan, a vender (contractor) develop a system basically under all-in contract with a user (contractee). But often using systems engineering service (SES) contract, one of delegation agreement. If it is case of all-in contract, user pays a cost for delivered system. However, if a SES contract, user pays a cost for man-hours of the vendor. For the reason that the user management the man-hours, it is on-site development under a SES contract. A delegation agreement is orininally applied consulting work. But a SES contract applied many systems developments because of low risks for both contractee and vendor. Actually, a SES contract is not a exact delegation agreement but likes a worker dispatching partially, that is ambiguous one. So often a SES contract becomes hotbed for lower-paying and hard work (of cource, that is violation of labor laws).

But I digress. Our company was built about 50 years ago. First it services monitoring of a data center. Now it develops a lot of big systems. Yet they are under SES contracts because it lacks of experience to develop big systems under all-in contract. Even the payment of employees is being increase year by year, but man-hours costs that agreed between user and our company is leveling-off. Then It gains has been decrease, especially about SES contracts. It is aserious problem both managers and sales. 

Generally, It is increased that gain from a system, in descending order, sale a packaged software, development under all-in contract and development under SES contract. It is clear from the ratio of the gross margin of iPhone (it is over 50%), sale a packaged software becomes profitable. The ratio of the gross margin of development under all-in contract is about 10-20%. When under SES contract, it is only under 10%. It is sure that sale a packaged software is advantage for vendors, but in Japan, users want to customize a software for their current status eve if it is inefficient. Because many cases the vendors gain from a packaged software as same as development under all-in contract. The Japanese vendors should get their users to change the practices of users. However that may be, If vendors want to gain more, they should cut Down SES contracts and roll up sale package softwares.

Our company sells self-development package softwares. These are developed old technology (i.e. Servlet 2.3) and useless. Addigionally, they are customized for customers requirements, so it is not sell softwares but entrusted development using self-development softwares.

When we found a technology that brings ease of development and be applied developing packaged softwares as "framework", there is Java EE 6. About 4 years ago, I was converted from on-site development to now section and make many samples about using Java EE 6 (i.e. JAX-RS, EJB 3.1, JPA, and more.) on GlassFish v3 Nightly Build and Ajax. It all started from reading a following article of WebLogic Channel, one of contents of Oracle Japan web site.

This article is about WebLogic 12c. But the contents almost be applied to GlassFish, JBoss and other Java EE 6 servers. I tell "No framework is needed yet" immediately, that based on the article and my researches about Java EE 6 and using GlassFish v3 Prelude/GlassFish v3 Nightly Build. Then, I make an generic architecture using minimal of Java EE 6 API, that if following chart. This proposal is based on GlassFish that was accepted our section, but I make alternative plan, using JBoss or WegLogic.

javaee6.png

The basis of this proposal is thoroughly component-based development (especially components of external interfaces is easy to reuse as our assets even if all-in contracts). In "SIer"s component-based development don't become common and uses monocoque construction likes COBOL while a half of century. Additionally, it uses JAX-RS instead of JSF, Servlet, JSP and other server-side pages technologies. So we can use any clients that can support HTTP protocol. The first proposal in 2011, the most dominant client technology is the combination of XHTML, CSS and JavaScript, that is narrowly-defined Ajax. It is excellent with matches smartphones and tablet computers (i.e. iPhone, iPad, Android, Windows Phone and so). Because It is able to access from Excel and Access (via MSXML ActiveX Control), It may accept to replace the existing EUC systems. And I said,

"Near the future, JavaFX 2.0 that is next generation Java GUI library, and it may be dominant client technology. It will be so powerful that beats (Excel or Access) VBA in usability. The business logic is run on any Java EE 6 server, GlassFish, WebLogic or JBoss. So it is never broken database as Access. If we deal with Java EE 6 and JavaFX as quickly as possible, It may be our advantage of business."

It was appreciated not only the members tired of Struts-based web application but also persons of sales division. They said it would be alternative technology of Access VBA and adaption of new solution with smartphone and tablet computers. To my regret, it is not more departure and became a dead issue in 2011. But I knew adding FXML to JavaFX and developing Scene Builder, visual editor for FXML, so I'm sure that JavaFX shall be accept again when JavaFX become common. Because the potential of JavaFX could imagine to watch demonstrations by Mr. Yuichi Sakuraba.

But the proposal is not necessarily other sections. I proposed mostly same one to a working group that wanted to build an in-house system in first half of 2012. They compared my proposal with new application framework based on Struts 2 by the R&D division, and they judged that R&D's is more easy to develop than mine (Thus mine is rejected, of all things, the reason of "ease of development"!). Indeed, their plan had been frustrated because I bailed out of it.

In second half of 2012, Our division returned to the black after 3 years away and R&D projects in our division is accepted at last. That is development of some packaged softwares, and our section has been at the forefront of implementing. There was an idea of my boss, and it was acclaimed at the higher level, and more, my proposal became to backup his idea.

3. Good bye, Java SE 6

The trial of development new package software is not only our work but also other teams independently each other. They has developed on their own themes. I don't tell about them what systems they are because of the credential of our company. Yet, I may bring out the technologies of our choice. Because we are building it depend on the open architecture includes some open source softwares.

My boss is the head of our section and the youngest manager of our company. He is so brightness that welcome to new technology, such Java EE 6 and other new Java technologies. Because he was the leading support person of my proposal in 2011. Then, JavaFX becomes a candicate of UI technology that is only some keywords in my proposal in last year.

Then I knew that EOL of Java SE 6 was until May 2012. There was prompt for upgrading to Java SE 7 quickly. As you know, JavaFX has been bundled with Java SE 7 Update 2 or later (JavaFX 2.1 with Update 4 or later, Windows and Mac. JavaFX 2.2 with Update 6 or later, Windows, Mac and Linux). And JavaFX Scene builder has appeared around the same time. It was even the developers preview yet, it brought more easier way to build a scene graph than both writing FXML and coding by APIs. Bundling JavaFX with Java SE 7 means that we use JavaFX only upgrading to Java SE 7. The EOL notice of Java SE 6 was backed up it. There was with newfound reality of acceptance of JavaFX in our section.

EOL of Java SE 6 was extended again and again, so it was finally set February 2013. At least, EOL of Java SE 6 is near at hand. And upgrading to Java SE 7 has progressed, slowly but surely.

I recommended JavaFX with 3 reason to my boss and the member; (1)Java SE 6 was out of date and nearby it's EOL. (2)Java SE 7 bundled JavaFX at that time and JavaFX has potential to build a rich UI (in other words, we can build UI by Java as easily as Excel/Access VBA). (3)JavaFX is successor technology of Swing and became a part of Java SE 8 (released in fall 2013). Finally I succeeded to induce them to accept to using JavaFX. From everything I has heard, There is few case of using JavaFX for products in "SIer"s.

At first, JavaFX bundled but using another installer to set up such as the public JRE. But it's runtime modules (jfxrt.jar and its dependencies) deployed with the path of JDK7 runtime (i.e. rt.jar) since Java SE 7 Update 6. (in the default, jfxrt.jar is exclude from the classpath of JDK7 runtime libraries.) There are some problem but it is realized to integrate Java SE and JavaFX tentatively. Then JavaFX Scene Builder 1.0 was released, at the same time Java SE 7 Update 6 was released.

4. How do I introduced JavaFX to my colleagues?

Even if there are useful technologies, It is no means that nobody can't use them. Unfortunately, the first members didn't Java SE 7, JavaFX 2 and Java EE 6 without me. Other members knew J2SE 1.4 and a part of J2EE 1.3 but didn't know JavaFX. Then I hosted a seminar on Java SE 7, and JavaFX 2.2, and I tried to update their knowledge to Java EE 6.

I think I have enough knowledge about Java SE and Java EE, but I lack to know JavaFX. So I use Mr. Sakuraba's slides for instructional material.

Unexpectedly, my presentation of Java SE and Java EE create a bad name. But introduction of JavaFX with Mr. Sakuraba's slides brought their attention. 

4. Trial

Even if I host seminars, it is not imageable with nothing screens and codes. Then I made a sample that is simple but having enough features. However, this sample is simplified version of it (but handling of web service is almost same). Because the true one was made in my office and designated for internal use only. 

The sample program is that send a client application by JavaFX to a server application on GlassFish Server and the server send back to client a time. The UI is following.

Application-1.png

When click "What time is it?" button, the server is a time and show it the label left of the button.

Application-2.png

The main feature of this application is that HTTP transfer between client and server using JAX-RS. See following source code.

4.1. Server side modules

(ApplicationConfig.java)

package jp.coppermine.samples.clockweb;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@ApplicationPath("/rest")
public class ApplicationConfig extends Application { }

(ClockResource.java)

package jp.coppermine.samples.clockweb;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.ws.rs.*;

@Path("/clock")
public class ClockResource {
  @GET
  @Produces("text/plain")
  public String now() {
    return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXX").format(new Date());
  }
}

4.2. Client side modules

(clock.fxml)

<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.text.*?>

<AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" xmlns:fx="http://javafx.com/fxml" fx:controller="jp.coppermine.samples.clock.Controller">
 <children>
 <HBox id="root" spacing="8.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
 <children>
 <Label fx:id="label" prefHeight="26.0" prefWidth="300.0" text="Press a button!">
 <font>
 <Font size="16.0" fx:id="x1" />
 </font>
 </Label>
 <Button fx:id="button" font="$x1" mnemonicParsing="false" onAction="#handleAction" text="What time is it?" />
 </children>
 <padding>
 <Insets bottom="16.0" left="16.0" right="16.0" top="16.0" />
 </padding>
 </HBox>
 </children>
</AnchorPane>

(ClockApplication.java)

package jp.coppermine.samples.clock;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

public class ClockApplication extends Application {
  @Override
  public void start(Stage stage) throws Exception {
    stage.setTitle("Clock Application");
    AnchorPane root = FXMLLoader.load(getClass().getResource("clock.fxml"));
		
    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.show();
  }

  public static void main(String[] args) {
    launch(args);
  }
}

(Controller.java)

package jp.coppermine.samples.clock;

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;

public class Controller {
  @FXML
  private Label label;
	
  @FXML
  private Button button;
	
  @FXML
  public void handleAction(ActionEvent event) {
    Client client = Client.create();
    WebResource resource = client.resource("http://localhost:8080/clockweb/rest/clock");
    String now = resource.get(String.class);
		
    label.setText(now);
  }
}

A sample such the scale is made a few minutes, but it have strong effect on their understanding. Even if it is a cheep sample, the runnable one convinced them its effectivity with few information.

I made a lot of other samples. Whole of those are useless for a part of a systems. But I succeeded to show the potential of JavaFX. Now the other members try to use various features of JavaFX. I think that they can do because by my runnable samples provided early on.

5. Scene Builder is great assistant for UI implementation

In our tems, "JavaFX" became a known technology. But it is that they feel the power of JavaFX is using JavaFX Scene Builder. At that time Scene Builder 1.0 is released and I recommended them Scene Builder.

If someone has an experience of development with Swing, he develops JavaFX applications easily. But no one know Swing well but most of the members have experience either Visual Basic or Access VBA. Then I got them to use Scene Builder and try to develop UI by visual editing on Java(JavaFX). They appreciated Scene Builder and said such a comment, "Scene Builder looks like Visual Basic. It feels that Visual Basic runs on Mac OS." For Visual Basic programmers, Scene Builder is very familiar tool.のです。

And it is another big surprise. I introduce not only Eclipse 4.2.1 but also NetBeans 7.2.1 to the project members. In "SIer"s, all developers use Eclipse because of the project or company policy, so we doesn't use NetBeans usually. "SIer" also use old copy of Eclipse, even Eclipse 3.4 is new one for "SIer"s. I against the ordinance of "SIer"s and tell any IDEs each one wants to use. It was by way of apology that I use the newest Eclipse (Eclipse 4.2.1). But one member that he tired old Eclipse tried to use NetBeans, then he liked it so much and recommended it to other member. Finally almost all members have using NetBeans. It is also unbelievable thing in "SIer".

As you know, Scene Builder and NetBeans are best partners each other. The team members casts in new light on thinking Java again by advanced development environment. And we selected JavaFX and Scene Builder to success of the project.

6. Epilogue

It is all about I say. In "SIer", that hates new technologies, I have introduced Java EE 6 and JavaFX. In this section, I may put togetter my feel while this some months.

  • In case of we replace ane the old technology to new one, if there are exist not had the new one but had the old one, the users reject the new one strongly whenever the new one beats the old one in whole. For example, to replace an application of Access VBA to web application based on GlassFish or JBoss. Its features and performance has no problem but the UI provided JavaServer Faces is so cheap than Access's UI that they seem the web application as new technology useless.
  • The end of life (EOS) is chance of introducing new technologies. Often in Japan, both the ventor and user is so passive for EOS that upgrade to new version and do regression tests. But if we show that it solves some issues by using new features, the users will consider it with a positive attitude. In this case, not only the EOL of Java SE 6 is near but also Java SE 7 has JavaFX, newer and better UI library, and it will replace UI by Access VBA. NIO.2 and Coin are very useful features for Java programmers but Access VBA users and programmers don't think so.
  • We never think new features are accepted in whole from the first. Struts is already dead, but many Japanese programmers and project managers use Struts as "the golden hammer". The other sides, there are people that live for making "Struts-based" in-house frameworks. If we recommend them Java EE 6, they will ignore it. And it is no reason that we tell useful things of JavaFX to people accept web application as holy writ. Fortunally, niche markets are exist in Japan (in this case, replacing Access VBAs is that) and any technologies and proposals will be accepted if they are consistent with the required of niche markets.

That's one small step for Japanese an IT engineer, one giant leap for all Japanese IT engineers.


The next article will be written by @tenntenn.