Object oriented software development is DEAD but it still lives on in my heart

Banner for Object oriented software development is DEAD but it still lives on in my heart

Object oriented software development is DEAD but it still lives on in my heart

As a developer who learned object oriented programming in the 90s, I find it laughable when people talk about how their SaaS application is object oriented. Service oriented applications aren't object oriented. They never have been and they never will be.

Why? SaaS applications are missing the one thing that matters in OO programming: Encapsulation.

Before we get into the specifics, let's define some OO concepts.

OO concepts

Core OOP Principles

Encapsulation

Bundling data and methods that operate on the data within a single unit (class), while restricting direct access to internal state.

This protects data integrity and allows you to change internal implementations without worrying about breaking external code.

Abstraction

Hiding complex implementation details behind simpler interfaces. For example, you can call list.sort() without knowing the sorting algorithm used.

Inheritance

Creates an "is-a" relationship between 2 classes. Use inheritance carefully and consider composition (has-a) as an alternative relationship.

Polymorphism

The benefit of inheritance. The ability to treat objects of different types using a common interface. Comes in two forms:

Runtime polymorphism: Method overriding (dynamic dispatch)

Compile-time polymorphism: Method overloading

Implementation Techniques

Composition

Creates a 'has-a' relationship. Allows building complex objects by using a simpler relationship than inheritance. For example, a Car has an Engine. Car doesn't extend Engine. This creates more flexible, maintainable code than deep inheritance hierarchies.

Design Philosophy

Design Patterns

Proven, reusable solutions to common software design problems. Organized into three categories: Creational, Structural, and Behavioral.

Beyond solving problems, patterns provide a shared vocabulary for developers.

Author note: I've struggled with the leverage point of this article, which is why it's taken so long to finish. So I've tried a bunch of approaches and decided to hit this one specific claim. Other attempts created articles way too long.

SaaS applications aren't object oriented because they don't have strong enough encapsulation

You might think all these ideas carry the same weight. If your application uses inheritance, that means you're working on an object oriented codebase. Right?

WRONG

Encapsulation isn't just one of the many traits or aspects of object oriented programming. It's the lynchpin that holds it all together. Without it, your codebase is too weak to be considered OO.

In a truly object-oriented system, objects must own their state. No one touches the internals except through the object’s own methods.

Open up any SaaS codebase, the backend services specifically, and what do you see?

  • Public DTOs with getters and setters on every field
  • ORM entities exposing database columns directly to the service layer
  • Controllers mutating domain objects without validation
  • JSON payloads flowing straight into business logic with zero mediation

This isn’t encapsulation. This is raw data plumbing disguised in objects.

It's a giant sack filled with data allowing any arm on the planet to stick their hand in, fish around, and do whatever they want to the contents.

Sure, you’ll find classes.

You’ll find inheritance hierarchies.

You’ll even spot some patterns like Strategy or Factory.

But if any place in the system can reach in and fondle an object’s parts then you don’t have objects. You at best have structs with methods.

Real encapsulation in SaaS would look like this

class Subscription {
  private CustomerId customerId;
  private Plan plan;
  private Status status;

  // No public getters. No public setters.
  public void upgradeTo(Plan newPlan, User actor) { ... }
  public boolean isActive() { ... }
}

The object guards its own invariants. It exposes behavior, not data. It enforces policy at the boundary.

Until your SaaS app does that, you’re not building object-oriented software.

You’re writing procedural code wearing class clothing.

And no amount of inheritance, polymorphism, or design pattern usage changes that.

But what about?

Objection 1: The Services are encapsulated, everything about the User goes through the UserService

This will probably be the most common rebuttal but it isn't good enough.

"Sure the User entity has public getters and setters, but only the UserService touches it. That's encapsulation albeit at a lower fidelity."

It's fair to say that this is a form of encapsulation but it's more of a coarse grained encapsulation. It sounds reasonable and feels organized. But it's a cope.

It's a cope developers came up with 20 years ago when the transaction volume got so high they had to horizontally scale their applications. Service oriented was the best solution but was, from their perspective, less object oriented. From my perspective no OO at all.

Claim 1: Only the UserService modifies User

Wrong! Any code with a reference to User can call user.setEmail(), including tests, controllers, or future services.

If you want to say this isn't important, I mean ok, I guess.

Claim 2: We validate in the service

Validating this way is scattered, duplicated, hard to maintain, bug prone, and worst of all optional. One missed check can lead to an invalid state.

Claim 3: It's fine because our team knows the rules

Human tend to forget. New hires don't know and in addition to learning the product they now have to memorize these rules. Refactoring causes much collateral damage.

Claim 4: We use dependency injection

Frameworks like Spring manage wiring and not behavior. Spring won't step someone from writing code that calls user.setEmail()

Just because it's not object oriented doesn't mean it totally sucks

When people discuss topics they often fall into a trap:

If something it good, then it has to have all the good traits and none of the bad traits.

That's not how the world works and in particular that's not how technology works.

There's always tradeoffs.

SaaS applications do trade high fidelity, object-level encapsulation for scale and simplicity. That is a completely rational trade.

It works. It scales. It ships. And SaaS runs all the applications on your phone, laptop, and on the internet.

Summary

SaaS isn't object oriented because its encapsulation is too weak to be considered OO. That's ok though because SaaS is a good trade off and runs applications the whole planet uses all day long.

But please, I'm begging you. Stop arguing that SaaS is object oriented. It's a claim that's completely wrong and causes confusion in a developer community that struggles with the entire coding craft that is OOP.