Switching from the old Java Generated HTML and JS Solution to a Full JavaScript Solution

06-Sep / 0 COMMENTS

Q: Seavus provides software development services to many clients around the globe. Many old projects need to be updated with the latest technology. Can you give us some example?
A: In one of the projects we completed for a client they used classic 10-year-old web architecture with java generated GUI.
Screen Shot 2015-09-06 at 1.17.11 PM


JavaScript side. However, after some time we found that developing JavaScripts was not so difficult, and that the process could be very swift and straightforward. The decision having been made, we put all business logic related to GUI on the JavaScript side.

Q: Was it hard to implement that JS solution?

A: The moment when we doubted our decision to switch to a JS-based solution came during the set-up of the technology stack. So many different libraries and JS frameworks were necessary for the set-up before it was possible to start the project. The task which took most of our effort, and the most challenging factor in this technology stack for us was to set up the unit and integration testing environment for the JS app. In the end we succeeded in setting up an environment similar to what we were accustomed to in Java.

Q: In the end you had GUI solution based on JS?

A: The JavaScript Application became a full-size client application – the reach client. There exists a communication layer, a data layer and an MVC. Also, there is a hierarchy of components with the corresponding mixins, and util scripts.

Screen Shot 2015-09-06 at 1.20.17 PM


Q: The beauty is in simplicity. Is this new solution complicated because of JS? Did you have problem to integrate the new solution into old system?

A: No at all. In the end, we integrated this into the existing web application with only one tag with a script link. It could be integrated into any other web app in the same way.

The configuration json is optional, and if it is omitted then the default configuration will be used. There is also the possibility to change any predefined configuration parameters, with in-line JavaScript.

Screen Shot 2015-09-06 at 1.21.18 PM


Communication between the old application and the new one is realized with JS events on the client’s browser side.

Q: What were the benefits of this approach?

A: There were many benefits from the built solution. The first prototypes showed that the Java server uses significantly less in terms of resources, and JavaScript frameworks enable flexibility on GUI parts such as animations and custom components, without any coupling to Java code or between JS files. Also any new JS library can be used in the future, as long as the library is AMD compliant. All JS components simply register themselves for certain events and throwing events when necessary, without the requirement for any dependencies. AMD encapsulates all used libraries as well as our code, and it will not come to clash with other JS on hosted web applications. It’s easy to maintain and ripe for further development.

Q: JS is popular these days but how mature is that technology?

A: Very mature, and in constant growth. The existence of advanced JavaScript libraries and frameworks such as Angular, Knockout, Require, Flight, BackBone and others, together with the testing frameworks Karma and Jasmine as well as tools such as Grunt, Bower, etc… have triggered many new projects based on JavaScript. Those projects are more visually appealing and at the same time they feature a great deal of business logic in JavaScript. JS has become required knowledge for web app developers. Those frameworks and libraries bear witness to rapid progress. Solutions based on JS will exist for a quite a long time. Even mobile development, which is in a state of exponential growth, can be achieved using JavaScript. Some examples are solutions based on Ionic, PhoneGap, Titanium, and others. With new upcoming standards such as http2 and ECMAScript6 the importance of JS will only grow.