Best of BaeldungJuly 2025

  1. 1
    Article
    Avatar of baeldungBaeldung·45w

    Introduction to Jimmer ORM

    Jimmer ORM is a new database framework that differs from JPA by requiring developers to specify data interaction details at the call site rather than through annotations. It uses interfaces as entities and relies heavily on DTOs for both reading and writing data. The framework includes a dedicated DTO language to reduce manual DTO creation overhead and supports multiple databases including MySQL, PostgreSQL, and Oracle. Unlike Hibernate, Jimmer doesn't implement dirty checking or traditional lazy loading, instead focusing on explicit data shape specification through DTOs and Object Fetcher APIs.

  2. 2
    Article
    Avatar of baeldungBaeldung·46w

    A Practical Guide to RecordBuilder in Java

    RecordBuilder is a Java library that enhances Java records with builder pattern functionality through annotation processing. It generates fluent builders, withX() methods, and consumer-based modification capabilities while maintaining immutability. The library eliminates boilerplate code for creating flexible object construction patterns and automatically stays synchronized with record structure changes, making it more maintainable than manual builder implementations.

  3. 3
    Article
    Avatar of baeldungBaeldung·45w

    How to Implement a Thread-Safe Singleton in Java?

    Explores multiple approaches to implementing thread-safe Singleton patterns in Java, including synchronized methods, eager initialization, double-checked locking, Bill Pugh pattern, and enum singletons. Compares their performance trade-offs and provides practical examples with test code to demonstrate thread safety in concurrent environments.

  4. 4
    Article
    Avatar of baeldungBaeldung·44w

    Introduction to Smithy

    Smithy is an Interface Definition Language (IDL) developed by Amazon for describing APIs in a language and protocol-agnostic format. It enables automatic generation of both client SDKs and server stubs from API definitions, serving as a single source of truth. The tutorial covers defining resources, operations, and services using Smithy syntax, then demonstrates how to use Gradle plugins to generate Java client and server code. Smithy focuses on resource-based APIs and supports various protocols like JSON over HTTP, offering more opinionated structure compared to OpenAPI or RAML while providing flexibility in transport and serialization methods.

  5. 5
    Article
    Avatar of baeldungBaeldung·47w

    A Guide to Spring gRPC Project

    Spring gRPC project enables developers to build gRPC servers within Spring Boot applications with minimal configuration. The tutorial covers setting up a project using Spring Initializr, defining Protocol Buffer files for service contracts, generating Java classes from proto files using Maven plugins, and implementing concrete gRPC services with Spring's dependency injection. A practical calculator service example demonstrates the complete workflow from proto definition to testing with gRPCurl.

  6. 6
    Article
    Avatar of baeldungBaeldung·44w

    How to Avoid Busy-Waiting in Java

    Busy-waiting occurs when a thread continuously checks a condition in a loop, wasting CPU resources. This inefficient approach can be avoided using blocking mechanisms like wait()/notify(), CountDownLatch, CompletableFuture, or Lock/Condition. These alternatives allow threads to pause execution until explicitly resumed, leading to more efficient and responsive multithreaded applications.