FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Primitive Obsession in Spring Boot DDD — before and after replacing UUID/Integer/String with Value Objects (code + video)
How-ToTools

Primitive Obsession in Spring Boot DDD — before and after replacing UUID/Integer/String with Value Objects (code + video)

via Dev.to TutorialDominik Paszek3h ago

Your Compiler Could Have Caught This Bug. It Didn't. This post accompanies episode 2 of my DDD series — building a real parcel locker system in Spring Boot from scratch. Source code on GitLab . We had a method like this in our codebase: public Parcel assignParcelDimensions ( Integer weightKg , Integer heightCm , Integer widthCm , Integer depthCm ) { this . weightKg = weightKg ; this . heightCm = heightCm ; this . widthCm = widthCm ; this . depthCm = depthCm ; return this ; } Four Integer parameters in a row. Swap two — it compiles. Passes review. Ships. And somewhere in production, a package ends up in the wrong locker because weight and width got mixed up. The compiler had all the information it needed to stop this. We just didn't give it the right types. The Problem: Primitive Obsession Here's the full Parcel domain class before we touched it: public final class Parcel { private final UUID parcelId ; // any UUID fits — even a lockerId private Integer weightKg ; // mutable, non-final

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
7 views

Related Articles

Building an MCP Server for Your Own Tools
How-To

Building an MCP Server for Your Own Tools

Medium Programming • 2h ago

[MM’s] Boot Notes — The Day Zero Blueprint — Test Smarter on Day One
How-To

[MM’s] Boot Notes — The Day Zero Blueprint — Test Smarter on Day One

Medium Programming • 2h ago

RHAPSODY OF REALITIES - 26TH MARCH 2026
"In Nehemiah’s day, as the people built the wall of…
How-To

RHAPSODY OF REALITIES - 26TH MARCH 2026 "In Nehemiah’s day, as the people built the wall of…

Medium Programming • 3h ago

How to Actually Make Money with a "Free" App
How-To

How to Actually Make Money with a "Free" App

Medium Programming • 3h ago

How-To

Building a Runtime with QuickJS

Lobsters • 4h ago

Discover More Articles