Module 93: Domain-Driven Design
Ubiquitous language
🏠The everyday picture
In a hospital, "discharge" means sending a patient home; in an electrical shop it means something completely different. Inside the hospital, every doctor, nurse and clerk uses the word the same way, and confusion is dangerous.
📘What it really is
-
Domain-driven design (DDD) (from Eric Evans' book of the same name) puts the business domain (the real-world subject: tutoring, bookings, payments) at the centre of software design.
-
Ubiquitous language: developers and business experts agree on one set of words with precise meanings, and use them everywhere: in conversation, documents, code, database tables and tests.
-
For the booking platform, decide precisely:
- is it a session, a lesson, a class or an appointment? (one word, one meaning);
- is a slot a time a tutor could teach, and a booking a slot a student has reserved?
- what does cancelled mean versus no-show versus rescheduled?
-
when is a booking confirmed: when requested, or when paid?
-
Why it matters: many bugs are misunderstandings. If the business says "a booking is confirmed only after payment" and the code calls unpaid bookings "confirmed", reminders go to people who never paid.
-
Learn from experts: interview tutors and administrators; listen for the words they use and the exceptions they mention ("sometimes a parent pays for two children"; "group sessions have a minimum size"). Run a short event storming workshop: write every business event on sticky notes ("Slot published", "Session booked", "Payment received", "Session cancelled") in time order, and discuss the gaps.
-
Keep a glossary in the repository, and rename code when the language changes.
🖱️Try it
Write a glossary of 15 to 20 terms for the booking platform with precise definitions, including the confusing ones (cancellation, no-show, reschedule, refund, confirmed). If you can, talk to a tutor or coaching manager for 20 minutes and update it with their words and exceptions. Check your Module 91 data model and API use the same words, and rename anything that doesn't.
✅Quick check
What's the ubiquitous language?
Show the answer
One shared set of precisely defined business terms used by everyone, in conversation and in code.
Why do mismatched words cause bugs?
Show the answer
Code then does something different from what the business means, such as treating unpaid bookings as confirmed.
