Video in progress
What is the "ubiquitous language" in DDD, and how does it affect the code?
The ubiquitous language is a single vocabulary that business experts and developers use together. One concept has the same name in conversation, in documents and in code, so "translation" errors go down.
📖 Answer
Imagine the loan department staff say "overdue payment", while the code has LateRecord, the database has delay_info, and Jira says "delay". Every conversation starts with translation, and somewhere the meaning gets lost.
With a shared language:
public class Loan {
public List<OverduePayment> overduePayments() { ... }
public void restructure(RestructuringTerms terms) { ... }
}
A business person can almost read this code, and a developer can carry what they say straight into the code.
Practical steps:
- at the start of the project, build a glossary: each term with its exact meaning;
- take class, method and table names from that glossary;
- don't use technical words (
Manager,Processor,Handler) in place of domain concepts; - if the business changes a term, rename it in the code too; if the old name stays, the language splits again.
One catch: a single language works only inside a single bounded context. "Customer" may mean one thing in the sales department and another in accounting, and that is normal.
Sign up to mark studied questions and save your progress.