In this week’s collection, we have explored topics such as how Spring Boot manages configuration properties, utilizing JPA for Single Table Inheritance, building reactive notification systems with SSE and Spring Boot, improvements in Java's handling of virtual threads, updates in Spring Framework and Spring Boot, and best practices for serialization, deserialization, and nested classes in Java.
Dive into these valuable resources to enhance your Java development skills. Also, consider subscribing to the newsletter to get weekly feeds on Java and Spring Boot articles.
📖 Helpful Resources
🚀 Ready to Level Up Your Development Skills?
Checkout: Get Your Hands Dirty on Clean Architecture 🚀
🚀Preparing For Java Interview?
Checkout: Grokking the Java Interview. 🚀
🚀Preparing for Spring-Boot Microservice Interview?
Checkout: Guide To Clear Spring-Boot Microservice Interview 🚀
🚀250+ Spring Professional Certification Practice Questions🚀
How Spring Boot Manages Application Properties
This article explains how Spring Boot manages application properties by using a flexible configuration system.
It highlights the importance of
application.properties
andapplication.yml
files, and how these files can be used to configure various aspects of a Spring Boot application, including database connections, logging levels, and server settings.It also discusses how profiles help manage different environments and how Spring Boot's auto-configuration works to simplify setup.
Query JPA Single Table Inheritance
This article on Java Code Geeks explains how to work with JPA Single Table Inheritance in Java. In this strategy, a single database table stores data for multiple entity classes that belong to a common parent class, using a discriminator column to differentiate between the types.
This article discusses the annotations and mapping strategies, specifically focusing on the
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
annotation.It highlights the pros and cons of this approach, such as simplicity and performance benefits, but also points out potential issues like table size and the challenge of querying specific subclasses.
Additionally, it covers techniques for querying these entities and managing their persistence correctly in JPA.
Reactive Real-Time Notifications with SSE, Spring Boot, and Redis Pub/Sub
This article from InfoQ discusses how to build a reactive notification system using Server-Sent Events (SSE) for real-time communication between a server and a browser.
SSE is used to push updates to clients over HTTP, and the article emphasizes the simplicity of implementation and the ability to maintain a persistent connection without the need for complex protocols.
Key considerations include ensuring that SSE is scalable, handling connection drops, and managing client connections.
The author also provides code examples, demonstrating how to create a reactive service that integrates SSE for notification delivery, and discusses performance optimizations and error handling strategies.
Java 24 Stops Pinning Virtual Threads (Almost)
Java 24 introduces improvements for virtual threads by minimizing thread pinning during synchronization, allowing better scalability for concurrent applications.
The discussion also touches on remaining challenges and tools like io_uring for performance enhancements.
Spring Framework 6.2 and Spring Boot 3.4 Improve Containers, Actuators ahead of New 2025 Generations
This article discusses updates in Spring Framework 6.2 and Spring Boot 3.4, highlighting enhancements that prepare them for next-generation applications in 2025. Key improvements include:
Container Environment Integration: Enhanced compatibility with modern containerized environments, improving efficiency and deployment.
Actuator Updates: Expanded monitoring and observability features via Actuator endpoints to better support production diagnostics.
Improved Testing: Updates to support emerging testing methodologies, likely in line with evolving developer tools and workflows.
Ahead-of-Time (AOT) Compilation: Expanded AOT support, aiding GraalVM Native Image compatibility for reduced startup times and lower resource usage.
Hibernate Group-By Using Criteria API
This article explains how to use Hibernate's Criteria API for performing group-by operations, focusing on grouping product data by category and calculating the total price per category.
It provides a step-by-step guide, including setting up a basic Product entity and creating a query with the Criteria API to sum the price for each category.
The article also includes unit testing for verifying the correctness of the query. It highlights the type-safe and dynamic nature of the Criteria API in building complex queries
Serialization and Deserialization in Java
This article on Java serialization and deserialization explains how these processes allow converting Java objects to byte streams for storage or transmission and then reconstructing them.
It covers the use of
Serializable
interface andObjectInputStream
/ObjectOutputStream
for serialization. The article also highlights key concepts liketransient
keyword, custom serialization, and performance considerations when dealing with large object graphs.
Nested Classes in Java: A Comprehensive Guide
This article on nested classes in Java explains the different types: static nested classes, non-static inner classes, local classes, and anonymous classes.
It covers their syntax, use cases, and advantages, such as improved encapsulation and code organization. It also discusses the scope and access rules for each type, providing examples to highlight when and why to use them. The article concludes by stressing the importance of understanding nested classes for better Java programming and efficient design
Mark–Scavenge: Waiting for Trash to Take Itself Out
The Mark–Scavenge GC is a proposed enhancement to garbage collection strategies, aiming to improve the efficiency of concurrent GCs by combining the strengths of scavenging and mark–evacuate techniques.
Traditional scavenging evacuates live objects during tracing and is memory-intensive but efficient in sparse areas, making it suitable for young objects.
Conversely, mark–evacuate identifies live objects first and relocates them later, excelling in dense memory regions and benefiting concurrent GCs by reclaiming memory as soon as live objects are identified.