Apparently, Java developers and I would assume the rest of the world, are tired of reading about AI. So, what else do Java developers want to talk about? I went around and asked some folks in the community what they would like to read about: This article will discuss 11 non-AI Java trends including GraalVM, DOP, Quarkus, Kotlin, Spring Security, Spring Modulith, Observability improvements, and more.
Here are topics that Java people want to talk about:
- GraalVm – (ram usage) and deployment
- A deep dive into DOP would be nice.
- Quarkus
- Spring Internals
- Kotlin + spring boot
- Spring Security 3 with OAuth2
- Data JDBC
- Compiled Template Alternatives to Thymeleaf
- Spring Modulith
- Runtime efficiency with Spring
- Observability improvements
Table of Contents
1. GraalVM
GraalVM is essentially an improved version of the JDK that includes ahead-of-time compilation to Native Image. It comes with the following features:
- Native executables consume less memory and CPU resources than a JVM, enhancing efficiency and cutting expenses.
- Native executables consist of only the necessary classes, methods, and fields in your application, decreasing the potential areas for attack.
- Precompiled native executables boot up immediately without needing any warmup to operate at optimal levels.
- Native binaries are compact and provide various linking choices, simplifying their deployment in lightweight container images.
- Well-known platforms like Spring Boot, Quarkus, Micronaut, and Helidon offer excellent compatibility with GraalVM.
- SDKs from top cloud platforms, such as Microsoft Azure, AWS, GCP, and Oracle Cloud Infrastructure, support and integrate GraalVM.
Quarkus initially positioned itself as the go-to framework for cloud-native applications, emphasising efficiency and performance. This strategy worked well during the early Spring Boot 2.0 era. However, with the rapid advancements made by the Spring team, particularly in the cloud-native space, many developers are now questioning the need for Quarkus.
2. Data-Oriented Programming (DOP)
Fundamentally, Java is an Object-oriented programming language (OOP). However, Object-Oriented Programming cannot efficiently solve all problems on its own. Over time, Java has borrowed useful concepts from other programming paradigms. Java 8 added support for Functional Programming, and now Java is gradually adding support for Data-Oriented Programming (DOP).
Data-oriented programming (DOP) is an approach to programming that treats data as first-class citizens. The programs are designed so that functions only change data by taking in one type of data, performing calculations, and outputting a different type of data. The data remains unchanged during computation because it is immutable, and the resulting data is also represented in an immutable form.
// OOP way
// Basket state is mutated as a new fruit is added
basket.addFruit(fruit);
// DOP way
// new basket is created with fruit
var newBasket = addFruit(basket, fruit);
Data-Oriented Programming in Java
In the article Principles of Data-Oriented Programming, Yehonathan Sharvit provided a clear description of DOP; he listed four principles of DOP:
- Isolate code (behavior) from data.
- Represent data with generic data structures (like maps, lists, sets, etc.; don’t use classes).
- Regard data as immutable.
- Separate data schema from data representation.
Is it possible to follow these principles in Java?
We can adhere to principles 1 and 3 by using immutable data types without instance methods and by writing functions separately; however, we cannot comply with principle 2.
3. Quarkus
Quarkus is designed for use in cloud, serverless, and containerised settings. Here are some important features of Quarkus:
- Performance: Application performance is enhanced by processing tasks during build time rather than runtime.
- Kubernetes-native: Deploying to Kubernetes is a straightforward process that requires minimal setup.
- Reactive and Imperative: Quarkus allows for both imperative and reactive code within an application.
- Simple development: Quarkus provides a range of tools for generating code, testing, debugging, and minimising boilerplate code.
4. Spring Internals
Spring Internals relates to the inner workings of Spring and the fundamental structure of the Spring framework. Important areas include Dependency Injection (DI), Aspect-Oriented Programming (AOP), Spring Beans, Application Context, Event Handling, and Transaction Management.
package ai.digma;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class AppConfig {
@Bean
public Observe myBean() {
return new Observe();
}
}
5. Kotlin with Spring Boot
Some developers went from Java to Kotlin and never looked back. Kotlin offers several benefits over Java, such as brevity, absence of null pointer exceptions, functionalities related to functional programming, and enhanced tools.
6. Spring Security 3 with oAuth2
Spring Security 3 is the preferred security framework for implementing authentication and authorisation in Java applications. It offers a robust set of tools to enforce access controls and safeguard resources.
7. Spring Data JDBC
Connecting with databases, reading, and inserting data in Java can be difficult. Spring makes database-related tasks easy with its abstractions, such as the JDBC template.
int result = jdbcTemplate.queryForObject(
"SELECT COUNT(*) FROM EMPLOYEE", Integer.class);
8. Compiled template alternatives to Thymeleaf
Thymeleaf is a Java template engine for server-side web and standalone applications. Many developers prefer Thymeleaf for its readability and easy navigation.
9. Spring Modulith
Spring Modulith assists developers in creating organised Spring Boot applications and helps them discover and manage domain-driven application modules.
10. Runtime Efficiency with Spring
Runtime efficiency with Spring speaks to improvements adopted in Java 21, such as Virtual threads and CRaC, which enhance scalability and effectiveness.
11. Observability improvements
Much attention has been drawn to observability improvements, especially in Spring Boot 3.2 and 3.3. Observability solves problems by providing insights into the behavior of microservices and their interactions. One tool benefiting from these improvements is Digma.
Conclusion
The Java trends discussed provide insight into what Java developers are interested in and the likely questions you’ll get asked in an interview for a Java developer role.