Book Image

JavaScript Domain-Driven Design

Book Image

JavaScript Domain-Driven Design

Overview of this book

Table of Contents (15 chapters)
JavaScript Domain-Driven Design
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Naming objects according to the domain


 

There are only two hard things in Computer Science: cache invalidation and naming things.

 
 --Phil Karlton

When exploring roles in a domain, the most complicated thing is most often the fact that we need to name the role that we try to establish in the system. When we are able to name a thing, we can naturally associate it with the role it plays in a system. When building a software system and being able to point out the roles by giving them concrete names, we make it easy for every developer working on the system to know where to put functionality related to the part they need to work on.

Previously, we introduced the concept of a carriage, comprising the cart itself, horses to tow it, and a driver. This is one example of naming a concept according to the domain. In the world of the orc dungeons, the concept of a carriage is very clear, and what is needed to run it is very clear. By using the language of the stakeholders in the system, we are increasing...