- read

Practical DDD in TypeScript: Specification

Marko Milojevic 41

Photo by Glenn Carstens-Peters on Unsplash

As a kid, I lived at a time in a place where the Internet wasn’t still the thing. And it didn’t become that in the next 15 years. Assuming that one day being able to buy a tool by just sitting in a chair — a blasphemy.

Then at some point, we got something called Teleshop. You know those two guys when one behaves like he is not from this planet and the other one explains to him how he can make everything with this new tool.

Disclaimer: Effective September 1st, 2023, the referral system on Medium
is no longer operational. If you appreciate this DDD series and would
like to endorse the efforts of both myself and fellow authors on Medium,
kindly demonstrate your support through claps, follows, or comments on
our blogs. Your consideration is greatly appreciated. Thank you in advance!

Other articles from the DDD series:

  1. Practical DDD in TypeScript: Why Is It Important?
  2. Practical DDD in TypeScript: Value Object
  3. Practical DDD in TypeScript: Entity
  4. Practical DDD in TypeScript: Domain Service
  5. Practical DDD in TypeScript: Domain Event
  6. Practical DDD in TypeScript: Module
  7. Practical DDD in TypeScript: Aggregate
  8. Practical DDD in TypeScript: Factory
  9. Practical DDD in TypeScript: Repository

I liked to watch that. I mean, I was a kid of ten — what do you expect? It was especially interesting to watch episodes with such tools that can do anything. A vacuum cleaner that can serve breakfast as well.

You take one thing and you can apply it wherever you want. That is exactly my first association with the Specification pattern in Domain-Driven Design — you can apply it anywhere you like and — it simply works.

But how does it help us? Many developers have experience with DDD, but hardly anyone with the Specification pattern. Is it so powerful?

Let us dive in.

For Validation