Do you need help with outdated Java Swing apps that are sluggish, have poor UI, and consume high resources? App modernization can be smoother with Vaadin’s Modernization Toolkit.
Ben Wilson recently hosted a webinar explaining how to migrate from any legacy Java Swing application to Vaadin Flow.
Vaadin Flow is a unique full-stack framework that lets you build web apps without writing HTML or JavaScript. Flow’s architectural simplicity lets developers start with and extend any existing Java code as needed. It provides all familiar Java features like event-driven syntax, exception handling, anonymous classes, and data types so you can directly transfer code for modernization. Ben thinks it is most likely that you can map over half of your application to Vaadin Flow without any changes!
The Vaadin Modernization Toolkit makes the process even simpler and more cost-efficient. Ben explains in detail how to use it for application transformation.
Continue reading for the highlights, or watch the full recording on YouTube.
What is the Vaadin Modernization Toolkit?
The Vaadin Modernization Toolkit is an automation support framework for transforming Swing and Vaadin applications into modern Vaadin Flow-based web applications.
There are many approaches to Java modernization. You can start with one (or several) proof-of-concept projects before tackling your main app. You can take a phased approach, or you can start directly. Regardless of your approach, any modernization project requires three tooling pillars to be successful.
- Assess—Quantify dependencies, assess impact, estimate effort
- Coexist—Phased modernization planning
- Transform—Automated refactoring of existing Java code.
Assess and coexist involve planning the project and managing risk, but the transform pillar concerns velocity for rapid modernization. The Modernization Toolkit supports code transformation, allowing you to reduce developer effort by 80% and significantly reduce modernization costs.
Understanding the code transformation process
Transforming your Java code means removing references in your application to legacy code or libraries that you want to move away from. For example, if you have 10 Swing buttons in your application, you must replace them all as part of the modernization process.
References in a Java application come from two primary sources—invocations and types.
Invocations
In the typical application, 80% of the references come from invocations to legacy libraries. Developers look for invocations of methods or constructors and find the class that declares the method. If the class is in the library that they want to move away from, they have to remove or rewrite it.
Types
Sometimes, the application code could subclass a type in the legacy library—for example, implementing the interface defined in the library, casting to a type, using the type as a type argument in a collection, or just declaring a local variable in a method. Any place in the application code that references a type declared in the library that you're moving away from also requires transformation.
How Vaadin Modernization Toolkit works
Automated application modernization in the toolkit takes a bottom-up approach and works by understanding the total references in your code and how many are suitable for automation. It supports the process in two ways.
Automated refactoring
The Dragonfly transpiler in the toolkit performs the automated code refactoring. The software takes the legacy Java source code as its input and produces an equivalent modernized Vaadin Flow version. The Dragonfly transpiler generates output that humans can read and work with. It retains white space, indentation, variable names, comments, etc., that support code comprehension. It gives almost line-by-line correspondence between the input and output so developers can quickly get the Dragonfly output into production-ready code.
See below an example code transformation from a sample Java Swing app (image 1) to Vaadin Flow (image 2). Swipe to compare.
Feature packs
The feature pack in the Modernization toolkit offers a different perspective on legacy code semantics. Beyond emulating APIs, it identifies and isolates specific behavior that doesn't exist in modern app development. The feature pack highlights old UI code that you won't find if you write a brand new application from scratch today.
For example, the Swing code often references a popup dialog box that freezes the rest of the application and forces the user to acknowledge by clicking the Okay button. Modern web apps replace this with notifications in the background. The transpiler output replaces such code with feature pack code so developers can quickly find and redesign those UI aspects—or leave them in if relevant.
Fine-tuning the toolkit
For the toolkit to really work for your unique project, the Vaadin team offers fine-tuning based on statistical analysis of your codebase. For example, let’s say our analysis shows that the transpiler and the feature pack handle 75% of reference removal. Our team analyzes the remaining 25% of references and determines the time and cost needed to implement removal in Dragonfly just for you. We give several options for optimum cost-benefit analysis. For example, ten days to go from 75-80% and 50 days for 75-90%. We also offer fixed cost and money-back guarantees so you can be more in control of your modernization planning and budgeting. Contact our team for more information.
Getting started with application modernization
The first step to get started is with a migration assessment of your existing applications. We offer three types of assessment;
- The full assessment that our team performs and can take a few weeks.
- Minifinder ballpark—you install and run our tool on your codebase to get an estimate.
- Modernization Toolkit assessment—we look at your code and give you a cost-benefit analysis for fine-tuning our Modernization Toolkit for your codebase.
You can then run the Modernization toolkit to get the work started. Your developers only perform the last remaining 10-20% of the work manually, getting the modernized app ready for production.
Learn more about Vaadin Modernization Toolkit or apply for a free assessment!