Optivem Journal

Optivem Journal

Clean Architecture

Clean Architecture vs Vertical Slice Architecture

“Why should I jump between ten different files just to understand one feature?”

Valentina Jemuović's avatar
Valentina Jemuović
Jul 24, 2026
∙ Paid

📅 Join me: Clean Architecture for Backend Developers on Wed 26th Aug, 5:00 - 6:30 PM (CEST)


🔒 Hello, this is Valentina with a premium issue of the Optivem Journal. I help Engineering Leaders & Senior Software Developers apply TDD in Legacy Code.


Every few months someone declares that Clean Architecture is dead.

The new answer?

Vertical Slice Architecture.

Usually it goes something like this:

“Why should I jump between ten different files just to understand one feature? Put everything for that feature in one place.”

Instead of splitting code into controllers, use cases, domain objects and repositories...

...put everything for PlaceOrder in one place.

One handler.

One folder.

One feature.

"Everything is in one place"

This is the promise of Vertical Slice Architecture.

PlaceOrder
├── HTTP Request Validation
├── Inventory Rules
├── Discount Rules
├── Price Calculation
├── SQL Query
├── ORM Mapping
├── SAP Integration
└── HTTP Response Mapping

Finance wants to change the discount rules.

Which parts are relevant?

PlaceOrder
├── HTTP Request Validation
├── Inventory Rules
├── Discount Rules ⭐
├── Price Calculation
├── SQL Query
├── ORM Mapping
├── SAP Integration
└── HTTP Response Mapping

Only one item matters.

The rest is noise.

But to find it, you have to going through request validation, persistence, mappings and integrations that have nothing to do with discount rules.

That’s the mental overhead.

Because the business logic is mixed in with everything else.

Don’t mix different concerns

With Clean Architecture:

Presentation Layer
├── REST API Controllers
├── HTTP Request Validation
└── HTTP Response Mapping

Application Layer
├── Place Order Use Case
└── Cancel Order Use Case

Domain Layer
├── Inventory Rules
├── Discount Rules
└── Price Calculation

Infrastructure Layer
├── SQL Query
├── ORM Mapping
└── SAP Integration

There’s more files, but…

Finance wants to change the discount rules.

You immediately know where to look.

Domain Layer
├── Inventory Check
├── Discount Rules ⭐
└── Price Calculation

Done.

You don't have to mentally filter out SQL, HTTP, ORM mappings and SAP integration first.

Because the business logic is isolated.

The context you DON’T need

❌ Vertical Slice

🔍︎ Find discount rule

  • Open PlaceOrder

  • Scroll past request validation

  • Scroll past database code

  • Scroll past SAP mapping

  • Finally change discount rule

✅ Clean Architecture

🔍︎ Find discount rule

  • Open Domain Layer

  • Change discount rule

💡Real-life Example: Ordering System

Finance doesn't just ask for one discount rule.

The rules start growing:

  • Premium customers get 10% off

  • Orders above €1,000 get another 5% discount

  • Some products are excluded

  • Discounts cannot be combined

  • Regional promotions override standard discounts

Now you need to change the discount calculation.

❌ Vertical Slice Architecture

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2026 Valentina Jemuović, Optivem · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture