Blog

Java Frameworks that Tech Companies Really Use
Lyudmyla Kyrylyuk
Lyudmyla Kyrylyuk
Marketing Content Manager

In a disrupted business world, technical component plays one of the crucial roles. Picking the right technology is half of the work done. Believe us! Especially now, when the world is all about mobile, user experience and security.

Frequently, we come across non-technical entrepreneurs trying to choose programming languages or technologies on their own. If you are this kind of founder, we want to stop you there. The best solution here is to find a partner with a technical background, who will be responsible for software related errands. Delegating technical staff to the technical person will pay off as it allows you to focus on business side while your co-founder cares about effective development.

java frameworks

This peace won’t make you technical guru. It rather aims to grasp basics and illustrate framework implementation on the real projects example. Based on our experience, we have chosen the best four Java frameworks.  

At first, we’d like to cover server-side frameworks, which makes it easy to write, maintain and scale web applications. And then slowly move to the frameworks that handle database connection. For server-side development, most often we use Spring Boot and Play frameworks. Those two are proved to be effective tools in the web development. 

Spring Boot

Spring Boot is a framework for quick web application development based on Spring Framework. The framework contains configurated components, which reduce time developers spend on application configuration. For example, setting up a new application manually takes over 4 hours, whereas with Spring Boot it takes up to 1 hour. Generally speaking, Spring Boot performs major configuration and dependency management on its own. Thus, allowing developers to focus on the application development. Additionally, Spring Boot provides a jar file with an embedded server. Which means you can start to work on the application without installing a web server.

Pros:

  1. Quickstart on standalone application and microservices
  2. The application is packaged into a single executable file, which is easy to distribute
  3. No old-style XML-based configurations, resulting in much easier and more flexible configurations
  4. Open source enables to track how everything works under the hood

Cons:

  1. Actually, there are no significant drawbacks and Spring Boot becomes number one framework

Play framework

Play is an open source framework written in Scala and Java. Alike Spring Boot Play aims at the convention over configuration. The framework utilizes features from Ruby on Rails and Java. It is a combination of Java type safety features and the simplicity and speed of RoR development. Also, Play framework abandons the traditional Java Web Application API (servlets) and provide a modern one. Play serves for high volume websites, enabling to write scalable services with simple and readable code.

The world’s biggest professional network Linkedin works on Play framework. Linkedin faced challenges using traditional Java frameworks and in 2013 switched to Play. The challenges were associated with time-consuming on processing changes and scaling issues. Combination of RoR and Java languages in Play enabled to solve critical issues and keep it simple for developers to adapt quickly.

Pros:

  1. “Hot” reload of developer-made changes increases developer productivity
  2. Easy and inexpensive to make remote calls in parallel. This is important for high-performance apps in a service-oriented architecture
  3. Open source with all benefits described above

Cons:

  1. Play 2.x is a new framework (unlike Play 1.x) which is not as popular as Spring Boot, and its community is smaller than its competitors and is not growing fast
  2. No built-in support for automated quality assurance tools
  3. Play replaces well-known environment called Maven with its own less popular called SBT. It may be challenging for some developers and thus hamper development time
  4. It recommends following contradictory software development practices, like plenty of public static fields. which may also hamper developer productivity when given to a large developer team.

java frameworks


When it comes to handling database connections, the most optimal solution is to use Spring Data JPA (with Hibernate under the hood) or Spring JDBC. For example, Spring Data JPA fits for small applications or projects at the initial stages. While Spring JDBC is better in a big applications development since it provides more control. Yet, it makes sense to combine these two to achieve the combination of productivity, control, and performance.

Spring Data JPA (with Hibernate)

Hibernate is an open-source Object-Relational Mapping framework, written in Java. This is powerful tool mapping database tables (living in database side) to Java classes (living in application side) and vice versa. Thereby, relieving programmers from routine work, where it is easy to make but hard to detect mistakes. Java is an object-oriented language, so it is easier to work with objects rather than with database directly. Hibernate acts as intermediary here. It translates database tables into objects and maps from Java data types to SQL data types.

To reinforce Hibernate functionality we use it in combination with Spring module called Spring Data JPA. The module is used in Data Access Layer of server-side to lessen all the boilerplate coding. Spring data JPA simplifies the usage of Hibernate by removing all the configuration and low-level APIs application.

Pros:

  1. It simplifies mapping between database side and server side thus increasing development speed
  2. Hibernate is a mature framework. Thus, most problems your developers will encounter were already discussed and solved online
  3. It’s a good fit for layered architecture which increases maintainability and modifiability of the system
  4. Open source with all benefits described above

Cons:

  1. For complex data, mapping from objects to tables and vice versa reduces performance and increases the time of conversion
  2. Lots of API to learn
  3. The lower performance of database-to-application communication

Spring JDBC

Spring JDBC is a framework that also handles communication between application and database. The framework performs all low-level queries, like opening and closing the connections. Comparing to plain JDBC, where all those actions performed manually, Spring JDBC simplifies the development process. Yet, it requires writing and maintaining more boilerplate code than Spring Data JPA (with Hibernate).

So what could be the reasons for using Spring JDBC? Its advantage is coarse-grained control over each column and table in the database. It increases the performance of application-database communication by using precise database queries. 

For example, web development platform Wix was building its base using Hibernate in the beginning. As the platform was growing, the development team found it difficult to work with Hibernate. So, they started migrating Hibernate-based solution to more performant and controllable one.

java frameworks

Pros:

  1. Spring JDBC is closer to SQL, which results in more control and performance
  2. Comparing to Spring Data JPA (with Hibernate) it allows handling errors more accurate
  3. Simple processing of SQL, which is more common for application and database experts
  4. Good for big applications with complex database structures where Spring Data JPA cannot offer enough control
  5. Open source with all benefits described above

Cons:

  1. Slower development speed comparing to Spring Data JPA
  2. More boilerplate code if developed by less experienced developers

To sum up

With this article, we intended to cover the most current frameworks used in Java development. We hope, it shed some lights on the project technical side. If you still have some questions on Java development, don’t hesitate to contact us.