Why there is no standard for developing real modular web applications?
Posted by Patroklos Papapetrou on July 19, 2011
OSGI, SpringSource, Jboss Modules,J2EE and the list never ends.All these technologies promise to their end users/developers the same thing which is more or less java modular web applications(?). How many of us out there, though, have actually tried to develop a REAL modular software system in Java? How many of us have managed to get it done? You have probably noticed that I have capitalized the word real and this is not done accidentally. I shortly explain what I mean by the definition:”real modular java system”.
IMHO a REAL software module should be able to have parts for at least business logic, persistence, user interface and configuration. A software module, in an ideal scenario, should be able to be plugged-in and plugged-off easily in a running application without restarting it. For example in a J2EE application server ( such as Jboss or GlassFish) the running application (core system) is a .war file. Some more modules (that contain parts mentioned above) of the core system are developed and packaged in separate jar files. These jar files shoule be deployed in the application server, integrated with the core system (by some extension points in business logic AND in User Interface ) without the need of re-deploying it. Can we do something like this?
Let’s see what related technologies suggest about it. I was a fan of JBoss Modules since their first steps, and after the recent latest release of JBoss AS I was looking forward to see them in action. To be honest JBoss modules provide a very simple and convenient way to define dependencies between modules. Oops!! Did I write “modules”? What kind of modules are these? They can include business logic, configuration, data model but what about user interface? Unfortunately nothing is mentioned about that and after a little research, I have found that the concept of modularity in JBoss modules does not include any user interface. What about OSGI? The most promising way of building moduar applications. OSGI is nowadays supported from many application servers and although its configuration looks like dinosaurs in the age of industrial revolution seems to be a very nice approach. Plenty of available services, a dozen of frameworks to use and of course no reference to any user interface capabilities. On the other hand there is vaadin that integrates(?) well with OSGI to build modular web applications, as the relevant article implies. I wonder if there is a real/productive modular enterprise application developed with OSGI and Vaadin. Spring is an independent framework by SpringSource which is currently the leader in developing java enterprise applications. Spring Dynamic Modules in conjuction with OSGI claim to be the most sophisticated way to build dynamic and modular web applications, but again I still feel that even Spring is not solving the problem I have raised. From my researching experience integration of the above technologies for a modular system is a hard task. Last but not least comes J2EE. The latest version of web and full profile specifications have transformed J2EE to a very powerful set of frameworks. JSF2 and CDI as well as with all the new features have dramatically increased its popularity among Java developers. When I read for the first time this article, I believed that finally I have found a standard solution for modular web applications. Although each jar can contain all different parts: business logic with EJB and CDI , persistence with JPA and its implementations, configuration and user interface with JSF and its implementations ) according to this issue there is no way to handle jars with JSF components as a separate module. One more dissapointment. Modules in J2EE are supposed to be jars packaged in a single war. That was too close!! We have to wait, I guess, until the release of JSF 2.2 and some months later for support of the most well-known application servers.
Since there is no standard for building modular systems, many well-known projects, have developed their own module system based on one of the previous mentioned frameworks or from the scratch. Jenkins, Atlassian’s Jira and Sonar by SonarSource are all java based applications with a powerful module / plugin system. You develop your plugin (including user interface), following some guidelines and you deploy it as a single jar through a module/plugin manager. In most cases you need to restart the system but I think that this does not bother any administrator since you can easily increase the functionality of your software.
So my dilemma is still valid. Should I start building my own module / plugin system or should I wait for a standard to come and boost the developing of modular web applications worldwide? I wonder why this kind of standardization is not yet available and why we are obligated to try-catch-finally ( still without resources🙂 ) among all these technologies and frameworks! Are we close to have a standard for developing real modular enterprise web applications or not?
Thanks for reading my thoughts and I am looking forward for your comments