Hey, there, it's Vlad again! Missed me? From the previous post, you already know the top Java frameworks and what they are usually used for. But from that variety, it is really hard to tell which one is the best. And you would probably not find the answer to that question. Each of them has its own advantages and disadvantages. Well, that's the title of this post, so let's start! But before we do, this is a great source of information about Java frameworks. So go check it out; it's worth it.
Spring
Advantages:
- focuses on providing flexibility
- lightweight, which allows triggering without any server
- uses JDBC for better performance
- fosters XML, annotation-based configuration, and modularity
- with backward adaptability and easy testability
- good for all architectural layers used in the web app development
- uses POJO model when writing classes
- very lightweight structure
- allows you to freely associate modules and test them easily
- supports declarative programming
- And much more about it here
Disadvantages:
- maybe complex for newcomers
- the lengthy preparation procedure, which caused the emergence of Spring Boot
Hibernate
Advantages:
- lightweight and easy to scale up, modify, and configure
- simple API for writing and fetching Java objects to/from the DB
- complex data manipulation with less coding
- fetching strategies minimize database access
- works without an application server
- used for RDBMS and the NoSQL database
- great Command-line tools and IDE plugins
Disadvantages:
- lower performance for complex queries
- complex for mastering by newbies
- steep learning curve
Google Web Toolkit
Advantages:
- includes JS files that can work with the major browsers' Java source codes
- doesn't require frontend skills to create UIs that are user-friendly
- allows creating cross-browser compatible apps with automatically produced JS code
- enables programmers to create Java client-side apps
- AJAX apps can be addressed in Java thanks to its extensive widget library
- supported by a team of experienced Google programmers
Disadvantages:
- difficult to learn for beginners
- doesn't support some features of modern browsers
- non-semantic HTML code generated by the frontend code
- requires much memory to run it in dev mode
- high compilation time
Tapestry
Advantages:
- all components are simple POJOs
- no dependencies on other libraries
- hot reloading of the code
- Ajax support and great exception reporting capabilities
- extensive library of built-in common components
Disadvantages:
- inability to add new components to an existing page dynamically
- limitations with service reloading
- running multiple applications are not supported
Dropwizard
Advantages:
- scalable
- simple to set up and get started with
- provides many features without becoming too complicated
- includes mature Java libraries
- has good conventions
- provides extensive documentation
Disadvantages:
- assumptions always change
- distribution and monitoring are complex
- the distributed environment needs to be tested always
Grails
Advantages:
- built on top of Spring Boot
- seamless integration with Java libraries and tools
- convention over configuration (with sensible defaults)
- async capabilities
- application profiles for React and Angular
- good documentation and tons of learning materials
Disadvantages:
- an interpreted language increases the weight
- might have an effect on performance (could work a bit slower)
- requires practical skills of Groovy to write Grails applications
- complicated integration process
Vaadin
Advantages:
- direct access to the DOM (Document Object Model) from the Java Virtual Machine
- displays the UI in the browser
- AJAX interaction between the browser and the server
- Java code is easier to write and debug
- existing Java libraries and tools (IDEs, compilers, testing) can be used
- no need to develop web services
- better security
Disadvantages:
- requires a lot of memory on the server for the UI view
- difficulty with solution scalability
- Java API is required while widgets development
JHipster
Advantages:
- mobile app support for Ionic and React Native
- architecture with cloud-native principles
- good test coverage
- supports infrastructure as a code
- extremely speeds up development
- support for many frontend frameworks and technologies
- built on top of Spring Boot
- has multiple deployment options
- strong, active community
Disadvantages:
- auto-generated code volumes may confuse offhand
- no typical Angular CLI
- lack of examples and tutorials
- complex documentation
Play
Advantages:
- easy to work with play-JSON and play-ws
- many components are separate dependencies
- great test libraries
- support from Scalatest, Specs2
- hot swapping of class files that improves the development speed
- easy end-to-end testing
- support for FluentLenium
- built around a functional programming core
- hot swapping of class files
Disadvantages:
- backward incompatibility
- a bit volatile at times
- has a very steep learning curve
- relatively recent move to dependency injection by default
Spark
Advantages:
- lightweight for rapid development
- has a dynamic nature
- requires minimal boilerplate code
- allows structure the app in any style you want
- has declarative syntax
- with great fault tolerance
Disadvantages:
- no file management system
- not enough tutorials and guides
- lacks algorithms
If you managed to read to this part, my congratulations! I hope this post was useful and you managed to find a Java framework that suits you the best. If you are still struggling with the right one, you can have productive communication with CTOs. For example, from Aimprosoft. Or you can check my previous post on IH called "My recommendation for your project. What Java framework should you choose?". It might help. Anyway, share your thought in the comments. See you next time!