
The design will tell us what are the modules of the application and what are their internal and external dependencies (dependencies to other modules or external libraries).Ī good design aims at minimizing dependencies and remove circular dependencies. Not surprisingly, it is also a key point for transpiling from Java to JavaScript.Įvery software has a design, which is more or less stable and well defined.

Software Design is the key for software construction, performance, and evolution. It means that all changes in the model or in the controller layers in the Java code base are immediately and automatically applied to the JavaScript counterparts, thus making maintenance and evolution of both applications much simpler. The main remaining efforts mainly consist in re-implementing the UI with JavaScript WebGL and canvas APIs, and to deal with resources and files (I/O).īesides saving development time, the other great benefit is that there is an automated bridge between the Java core code base and the JavaScript one. In total, we estimate that the automated translation saved about 100 days of development, which represent about 25% to 30% of the total development effort.

To make it work, JSweet also transpiles automatically general-purpose Java packages that are part of the AWT/Swing library, such as the and packages (resp. Amongst these, Emmanuel and I are able to transpile automatically around 50K LoC, leading to 68K JavaScript-generated LoC ( by automatic transpilation, I mean that the generated JavaScript code can be run in the browser as is, without any manual adaptation of the code). Sweet Home 3D represents 130K Java Lines of Code (LoC). In this post, I will explain how JSweet helps building the online JavaScript Web version of an Open-Source interior design application called Sweet Home 3D developed and maintained by Emmanuel Puybaret. A real-life example of migrating a Java application to JavaScript.
