My TypeScript Software Design & Architecture book just prelaunched! Check out

Should an ID Be an Entity? - Domain-Driven Design w/ TypeScript

Jul 23rd, 2019 / 1 min read / Share / Edit on GitHub
Should unique identifiers be their own entities?

This is part of the Domain-Driven Design w/ TypeScript & Node.js course. Check it out if you liked this post.

Also from the Domain-Driven Design with TypeScript series.

In this article, we talk about how we actually chain business logic using the Domain Events and the DomainEvents handlers map class, etc.

We should also talk about how this works well for a monolith application.

We should also talk about how we can eventually do this kind of stuff over a message broker / queue to cross subdomains

Why do we sometimes refer to entities directly, like Genre, but then sometimes refer to the ids of entities, like ArtistId instead of Artist? Why not just refer to the entire Artist in the aggregate?


Thanks for reading! Share this article if you found it useful.


Be the first to leave a comment


Stay in touch!

About the author

Khalil Stemmler

Khalil Stemmler is a Developer / Designer and co-founder of Univjobs. He frequently publishes articles about Domain-Driven Design and Advanced TypeScript & Node.js best practices for large-scale applications.

View more in Domain-Driven Design

You may also enjoy...

A few more related articles

An Introduction to Domain-Driven Design - DDD w/ TypeScript
Jul 30th, 2019 / 12 min read
Domain-Driven Design is the approach to software development which enables us to translate complex problem domains into rich, expr...
Handling Collections in Aggregates (0-to-Many, Many-to-Many) - Domain-Driven Design w/ TypeScript
Jul 25th, 2019 / 10 min read
In this article, we discuss how we can use a few CQS principles to handle unbounded 0-to-many or many-to-many collections in aggre...
Challenges in Aggregate Design #1 - Domain-Driven Design w/ TypeScript
Jul 25th, 2019 / 5 min read
In this series, we answer common questions in aggregate design. Here's an article orignating from the question, "How can a domain ...
How to Design & Persist Aggregates - Domain-Driven Design w/ TypeScript
Jul 24th, 2019 / 28 min read
In this article, you'll learn how identify the aggregate root and encapsulate a boundary around related entities. You'll also lear...

Want to be notified when new content comes out?

Join 2000+ other developers learning about Domain-Driven Design and Enterprise Node.js.

I won't spam ya. 🖖 Unsubscribe anytime.

Get updates