Skip to main content

3 posts tagged with "Language Features"

Programming language features, syntax, and semantics

View All Tags

Choosing Between OOP and Data-Oriented Programming in Java

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

Java developers have spent decades learning a reliable reflex: see a variation, create an interface, add implementations, inject the one you need. It is a good reflex. Polymorphism gives us extensibility, keeps dependencies pointed at abstractions, and makes a growing family of behaviors manageable.

It is also possible to turn that reflex into a small framework for a problem that was just a switch away from being obvious.

The trouble starts when an object hierarchy is really just data arriving from another system and our application needs to perform a few operations on it. A second hierarchy of strategies, visitors, factories, and registries can preserve the Open/Closed Principle while making the business rule much harder to find. Modern Java gives us another option: model a closed set of data explicitly and use pattern matching to describe what each case means.

In this post we'll look at:

  • Where OOP and polymorphism are still the right tool -- extensible behavior and stateful domain concepts
  • When a hierarchy becomes accidental complexity -- especially around third-party types and integration data
  • How records, sealed types, and pattern matching support data-oriented code -- with compiler-checked handling of every case
  • How to choose without turning the decision into a religious debate -- based on the direction your system is likely to change

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

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 **