Java 2021: What Frameworks and Trends for This New Year?
Find out what are the trends of the new year in the Java world. Discover the impacts of the new trend of reflectionless frameworks and their impact on architecture.
Join the DZone community and get the full member experience.
Join For FreeFrom a technical point of view, the frameworks within the Java world are one of the biggest differentials. It’s challenging to see an application in Java without using any tool, using only the Java SE platform. With the new year, it is natural that questions arise, such as which frameworks are available in new projects, types of frameworks, and trends. The purpose of this post is to talk a little about the most popular frameworks in the Java world and the expectations for next year in one of the most popular languages in the world.
It is indisputable that the annotations, or metadata facility, facilitated a lot within the world. In general, the vast majority of frameworks use this type of resource. However, what changes are related to when these annotations will be read:
At run time: The annotation information is read as soon as the Java application starts and that, in general, uses the Java Reflection API. What facilitates the pluggability and/or plug-and-play effect from which it is possible to modify the application's behavior simply by adding dependencies. Another point is the ease of encapsulation. For example, thanks to reflection, it is possible to have an attribute without a setter. The auto incremental identifier and reflection will solve this smoothly.
At compile time: This approach aims to bring all Java metadata processing and analysis to the compilation time rather than the execution time. This type of approach tends to decrease the time to start and also the memory consumption. One way to accomplish this approach is with the Java Annotation Processor.
As mentioned earlier, metadata reading is a great game-changer for the types of frameworks, since in general, the most used frameworks this year have very similar characteristics:
More than a framework, a platform: The most famous frameworks in the year 2020 and tend to stand out in 2021 stand out for having a collection of tools within their umbrella to assist developers at various points, whether in Security API is like integrating a rest API.
Dependency injection: In general, a container responsible for managing dependencies within an application. A great tool for keeping loosely coupled within an architecture.
Access with database and service: Connecting a database, whether relational or non-relational, is important; after all, if the application is the mind, the data is the heart of a system. At this point, the entire possible boilerplate between the Java application and the database is reduced.
Configuration outside the code: Credentials such as a database user and password must be outside the code. In the ideal environment, the developer or architecture team does not need to know such information, following the twelve application factors' best practices. These ecosystems have the option of overwriting all configurations through environments. It is possible to have a configuration for each environment in a transparent way to the application.
Based on these characteristics of the Java tools mentioned previously, the Java frameworks that stand out are:
Quarkus: The most recent project created by Red Hat whose main objective is to have a quick start-up and lower memory footprint such as technologies like NodeJS and also Go.
Micronaut: Possibly the first platform in Java developed to work very efficiently in a serverless architecture.
Spring: Coming from a book written by Rod Johnson, it is based on an extension and improvements around Java EE, currently Jakarta EE.
Jakarta EE / MicroProfile: Although not necessarily frameworks, but specifications. These projects drive and serve as a basis for previous projects. The important point is that thanks to the specifications, it is possible to change implementation straightforwardly, and we have several vendors working and with implementations such as Wildfly, Payara, TomEE, among others.
The table below shows the relationship between these ecosystems and their respective components. One point as shared among the frameworks is that everyone has the rule to map the properties to the environment variables' information. This feature is interesting if, for example, you want to have a configuration properties file to be executed locally, which will be overwritten in production transparently for application to the point that even the development team will not need to know this information.
Framework |
Metadata |
Data |
Configuration |
DI |
Quarkus |
Reflectionless |
Eclipse MicroProfile Config/Binding from Environment Variables |
||
Jakarta EE/MicroProfile |
Reflection |
Eclipse MicroProfile Config/Binding from Environment Variables |
||
Spring |
Reflection |
|||
Micronaut |
Reflectionless |
The Most Popular Frameworks in a Cloud Environment
It is always important to mention that there are service modalities in the cloud world according to the level of operation abstraction that the developer or the development team wishes to delegate to the cloud. The greater the abstraction, the lower the business's risk; however, the cost of the service tends to be higher. The big point is that managed services, like Dan Moore in 97 Things Every Cloud Engineer Should Know: Collective Wisdom from the Experts, contain the installed software and all the maintenance and management knowledge of these services, simplifying the life of the entire development team.
In this type of service, we can categorize PaaS, platform as a service, since it makes the development team focus on delivery and drastically reduces the share of operations in the cloud. For example, by using a PaaS Platform.sh, it is possible to reduce the complexity of operations and the risks involved in using the cloud:
Reduces the complexity of trivial operations such as backup/restore, JVM, and database updates.
It uses the concepts of GitOps, that is, ease in deploying frequently, ease in managing environment variables. It also has integration with Github, Bitbucket, and GitLab.
Defines access control between applications and services such as a database.
Ease with CI/CD
Services already integrated, so just tell us what services your application needs, and Platform.sh will manage all information for the application.
To facilitate the migration of existing systems or the creation of a new one based on the cloud, Platform.sh has created the following guides for the most popular frameworks in the Java world:
One of the strongest features of the Java world is found in many frameworks, of which this article mentioned the four most popular development platforms. A strong feature within the framework architecture is found in the way of reading the annotations, either at the time of execution or at compilation time. The common points among Java frameworks are the fact that they have a dependency injection mechanism, a configuration of good practices, and Platform.sh support that simplifies and speeds up the application in the cloud environment.
Opinions expressed by DZone contributors are their own.
Comments