Skip to main content

7 posts tagged with "Java"

Java programming language content

View All Tags

Shared Spring Boot Modules Without the Internal-Framework Trap

· 10 min read
Ouwesh Seeroo
Senior Java Developer | Tech Enthusiast

Shared code starts with good intentions: stop copying the same tracing setup, validation rules, or test helpers into every service. Then, six months later, you have a mystery JAR that pulls in half of Spring, overrides application beans, and requires a Slack message to configure.

The problem is not sharing code. The problem is treating a shared library as a bucket of reusable classes instead of a product with consumers, compatibility promises, and a sensible onboarding path.

In this post we'll look at:

  • A module layout that keeps framework code contained — core code stays portable while Spring Boot integration stays convenient
  • Starters and auto-configuration that help instead of hijack — useful defaults with clear escape hatches
  • Configuration and test support as part of the public API — discoverable properties and reusable conventions
  • Documentation and releases that scale to more than one project — fewer archaeology sessions and safer upgrades

Lazy JDBC Connections in Spring Boot 4.1 (Performance Win)

· 7 min read
Ouwesh Seeroo
Senior Java Developer | Tech Enthusiast

Every time a @Transactional method runs in your Spring Boot application, Spring grabs a JDBC connection from the pool. Immediately. Before your code even executes. Before it knows whether you'll actually touch the database. That connection sits there, reserved for you, doing absolutely nothing — while some other thread might be blocked waiting for a free connection. Your Hibernate second-level cache just returned the result from memory? Doesn't matter. Connection was already checked out. That's the equivalent of renting a car to walk across the street.

Spring Boot 4.1 fixes this with first-class support for lazy JDBC connections. One property. Massive performance win.

In this post we'll look at:

  • The problem with eager connections — why Spring grabs a connection before you need one
  • What LazyConnectionDataSourceProxy does — the mechanism behind lazy fetching
  • Spring Boot 4.1's auto-configuration — enabling it with a single property
  • Before vs after — what you had to do manually (and why nobody bothered)
  • Real-world scenarios where this shines — cache hits, conditional logic, and read/write routing

A Practical Guide to Java Records

· 9 min read
Ouwesh Seeroo
Senior Java Developer | Tech Enthusiast

Java records, introduced in Java 16 (JEP 395), finally let you delete Lombok. You know, that library you added to avoid writing 50+ lines of getters, then spent hours debugging @Data annotation conflicts and weird IDE plugin issues. One line. No plugins. No magic. Just the Java compiler doing what it should have done 25 years ago.

In this guide, you'll learn:

  • The problem records solve — why we needed them
  • Core syntax and features — compact constructors, immutability, and generated methods
  • Real-world patterns — DTOs, value objects, projections, and configuration
  • When records fit (and when they don't) — practical guidance for your codebase

Optimizing Spring Boot Docker Images

· 5 min read
Ouwesh Seeroo
Senior Java Developer | Tech Enthusiast

Docker images for Spring Boot applications often start bloated—large downloads, slow CI/CD pipelines, and unnecessary attack surface. This post shows you how to dramatically reduce image size while improving security and build speed.

In this post we'll look at:

  • Using JRE base images on Alpine Linux
  • Multi-stage builds for clean, consistent images
  • Layered JARs for blazing fast rebuilds
  • Summary of improvements and trade-offs

What’s New in Java 25

· 9 min read
Ouwesh Seeroo
Senior Java Developer | Tech Enthusiast

Java 25 continues the recent Java trend: fewer flashy features, more small, sharp tools that make everyday code safer, faster, and easier to reason about.

In this post we’ll look at:

  • simpler main and java.lang usage
  • constructor “prologues” and inheritance
  • ScopedValue vs ThreadLocal
  • runtime & performance improvements
  • _ as an unnamed parameter/pattern
  • sealed types with safer switch
  • **gatherers: custom intermediate stream operations **

Building a Flexible Calculator Engine with Strategy and Factory Patterns in Spring Boot

· 3 min read
Ouwesh Seeroo
Senior Java Developer | Tech Enthusiast

In this article, we'll explore how to build a flexible and maintainable calculator engine using the Strategy and Factory design patterns in a Spring Boot application. This pattern is particularly useful when you need to apply different calculation rules based on different jurisdictions or conditions.