Imagine a bacon-wrapped Ferrari. Still not better than our free technical reports.

The Ultimate Java Web Frameworks Comparison: Spring MVC, Grails, Vaadin, GWT, Wicket, Play, Struts and JSF

2. Framework Complexity

This section is where we explore each framework’s construction. Here, we’ll discuss how many moving parts exist in each framework and how the complexity of the framework affects you. Do you really want to learn 10 technologies to use a framework? There are also other considerations when choosing frameworks, such as whether the extra features and benefits outweigh the extra complexity levied against frameworks for your application. Remember the old adage, “what you choose in development, you support in production!”

Spring MVC

Spring is the Mount Everest, the Pacific Ocean, the Stegodon of frameworks. The base Spring framework gives a solid foundation for over 22 subprojects, which increases with the scope of your application. These mature projects range from your “basic” fully functional MVC to Spring .NET and Spring for Android.

Spring MVC architecture is relatively simple, but still there are many layers and abstractions that are sometimes hard to debug if something goes wrong. And it is highly dependent on Spring Core.

Score: 3.5/5 — Spring scares away newbies and people who love simple and lightweight things. It is old and mature framework that has numerous amount of ways to extend and configure it – and this actually makes it fairly complex.


Grails

Grails’ MVC functionality is covered by Spring MVC; GORM (Grails’ Object Relational Mapping) is actually a facade for Hibernate. Everything is glued together with core Spring. All of these frameworks are mature, but heavy-weight and Grails adds another layer of abstraction on top of it. Grails also tries to be a full-stack framework by having it’s own console, build tool and a lot of plugins. All this can make things very complicated when it comes to debugging some nasty issue.

Score: 3/5 — Grails has all of the complexity associated wtih Spring and Hibernate, and adds another layer of abstraction to that.


Vaadin

The Vaadin Framework currently builds upon a flavour of GWT (lightly altered), which is a mature framework. The way you’d go about developing a Vaadin project is similar to GWT in the sense that you could create a hierarchy of components, but learning GWT is not a prerequisite to be competent at using Vaadin.

Score: 4/5 — Slightly more complex than GWT, as it embeds a version of it, but not enough to drop it any marks.


GWT

GWT is a pretty complex, if small framework for being so easy to use. You only have to worry about the Java code and what components you want to put where (or just drag and drop components using the Design mode and let GWT auto-generate all that code for you) and GWT cross-compiles that code into highly-optimized JavaScript that works across all major browsers.

Score: 4/5 — Pretty complex framework with an interesting execution that makes your life easy to develop with, either through code or through the drag and drop Design mode.


Wicket

For being an MVC, Wicket can be fairly straightforward. It has clean HTML and a large library of components and a wide range of model objects that the components can use to retrieve or push data. However, the model inheritance can be pretty difficult to grasp initially and, while it increases code reuse, it reduces readability and is unnecessarily complex.

Score: 2.5/5 — A straightforward framework but with an unnecessarily complex model inheritance system that is useful but also difficult to grasp.


Play

Play is quite a complex framework, and there are a lot of moving pieces. This makes sense given how robust of an ecosystem the Play framework provides. The framework comes with Netty, SBT, Akka, a Scala templating engine, and several other modules built in. Play emphasizes convention over configuration, so the framework is responsible for scaffolding much of the glue and configuration between the modules, which does cut down on the complexity experienced by you, the developer.

Score: 2/5 — Play provides an entire ecosystem instead of just a framework, which helps provide a lot of features. However, you do need to know something about Scala, which adds additional complexity.


Struts

Struts isn’t lightweight, but it isn’t overly complex either. When a user request comes into Struts, there is an Action (Struts’ term for a controller) to be performed and interceptors to be invoked before and after the action. Interceptors can manage logging, security, double-submit guarding etc. Official documentation states that “The default Interceptor stack is designed to serve the needs of most applications. Most applications will not need to add Interceptors or change the Interceptor stack.” The result of the action is rendered using chosen view technology. That’s the whole magic.

Score: 4/5 — Struts is pure MVC with a more or less straightforward architecture. No extra components that may add complexity.


JSF

JSF is incredibly complex, and that is the largest downfall of the framework. However, this is not JSF’s fault, this is due to the Java EE specification and the inflexibility of runtimes available. There are open source implementations of the JSF specification that do allow the use of non-Java EE containers like Tomcat, which cuts down tremendously on the complexity of having to run a full Java Enterprise application server (there are middle grounds though, like WebSphere’s Liberty Profile). The complexity does come with the benefit of access to the rest of the Java EE stack.

Score using JSF in a Java EE stack: 3.5/5 — When using the Java EE implementation of JSF, we must account for the complexity of the Java EE specification and running a full Java EE server, and one would be hard pressed to claim that the Java EE specification is not complex.

Score using JSF in an OS implementation: 3/5 — When using an OS implementation of JSF, we need to account for the complexity of the underlying framework that JSF is being run on top of.

web-frameworks-framework-complexity

Framework Score

Vaadin

4

GWT

4

Struts

4

Spring MVC

3.5

JSF*

3.5

Grails

3

Wicket

2.5

Play

2

* Using Java EE Implementation score


DOWNLOAD THE PDF