‘Completed order’ has three meanings. Your SQL picks one
The WHERE clause chooses silently, and the FDE on site at the client pays for a wrong choice with the client's trust.
In brief
- Words with several meanings, such as 'Customer' or 'Product', are a recurring source of confusion in software projects, and departmental culture usually draws the lines between those meanings.
- Do not force a whole company to use one meaning: give each meaning its own name, an owning department and a measurable rule.
- A glossary earns its keep in column names, metric names and the semantic layer; on a wiki page nobody reads, it is worthless.
The dashboard says 1,000 orders were completed this month. The chief accountant’s books say 850. In this hypothetical case, an FDE in the second week at a retailer is demoing “Completed orders this month”: the head of sales nods, the chief accountant frowns, and the pipeline has no bug. The two of them are counting different things under the same name.
Martin Fowler describes this as something that happens on project after project: words with several meanings, such as “Customer” or “Product”, cause endless confusion. For an engineer building an internal product, the price is a few meetings.
For an FDE on site at a client, the price is trust. Once people have seen one wrong number, they read every later one with suspicion.
The reason to deal with this before writing code is simple. Software, Fowler writes, does not cope with ambiguity. People can say “completed order” and still understand one another from context. A WHERE status = 'completed' clause has to choose exactly one meaning, and it chooses silently, telling no one.
Why does one word have three meanings?
Alberto Brandolini, the creator of Event Storming, says bluntly that terminology is ambiguous by nature: people interpret the same word in their own way because each department has its own perspective and needs.
A post on the Codurance blog gives an example from inside a single company: a business expert and an accounting expert may attach two different concepts to the same word.
Fowler makes a more memorable point. The boundaries between business contexts are usually set less by technology than by human culture: which groups work together, and which department is responsible for what. Each context may have an entirely different model of the same concept.
Winning an argument about the “right” meaning is therefore the wrong goal. Three Dots Labs’ documentation is clear that the same word meaning different things in different contexts is normal, provided the boundaries between those contexts are clearly drawn.
The FDE’s job is to bring each meaning into the open, name it and record where it applies.
One word, three numbers
At the retailer, sales considers an order completed when the customer’s payment goes through. The warehouse considers it completed when the goods have been scanned out and handed to the carrier. Accounting considers it completed only when the customer has received the goods, the return window has closed and there has been no refund.
Suppose that this month 1,000 orders were paid successfully, 920 left the warehouse, and 850 passed the return window without a refund. The dashboard counts by payment status, so it shows 1,000. Accounting records 850. That gap of 150 orders is not a data error but a definition error.
Now add a customer service agent that answers the question “Is my order completed?” If the agent uses the sales meaning, it will say “yes” about an order still sitting in the warehouse. The definition error is the same, but this time it goes straight to the end customer.
Once settled, the glossary for this example might look like this:
| Standard name | Owning department | Measurable rule | Data field | Edge case settled |
|---|---|---|---|---|
| Paid order | Sales | Payment transaction succeeded | payment_status = 'captured' |
When does a cash-on-delivery order count? |
| Shipped order | Warehouse | Has an outbound warehouse scan | shipped_at IS NOT NULL |
Partially delivered order |
| Settled-revenue order | Accounting | Delivered, past the return window, no refund | settled_at IS NOT NULL |
Order exchanged for a different product |
The word “completed” is deliberately absent from the table. From here on, “completed” on its own must not appear in code, metric names or agent prompts.
Settle the glossary in five steps
The first step is to collect the words. Read tickets, table names, column names, the client’s Excel files and meeting notes, and mark the nouns that appear most often. The most familiar ones, such as “customer”, “order” and “product”, are usually the most dangerous, as Fowler warns.
The second is to ask each business expert separately, as Codurance advises. Avoid “What does completed mean?”, which only draws generic answers. Ask about edge cases: “Does a half-refunded order count?” “If a customer exchanges a size, what happens to the original order?” Such cases expose the definition people are really using.
The third is to bring the departments into one session. Three Dots Labs considers Event Storming one of the best ways to discover and agree on vocabulary between developers and stakeholders.
When events such as “customer pays”, “goods leave the warehouse” and “return window closes” are posted in time order, everyone can see where on the line their own “completed” falls.
The fourth is to name each meaning and assign an owner. Every meaning has its own name, a department responsible when the definition needs to change, and a rule a machine can run. “The order is fine” is no definition. “Has settled_at and no refund record” is.
The fifth is to put the glossary into the system. Eric Evans calls the destination ubiquitous language: a common, rigorous language between developers and business users, used identically in meetings and in code. Variable names, column names, metric names and agent tool descriptions should all use the standard names.
Tools help at this step. dbt’s Semantic Layer lets teams define a metric once in the modeling layer so that every business unit shares the definition, whichever tool it uses.
When a definition changes, the change carries through to everything that calls it. At Palantir, the Ontology describes the client’s organization in objects, properties and links. But tools only store definitions. Choosing which one to use remains a matter between people.
Mistakes that kill a glossary early
The most common mistake is to adopt the meaning held by the loudest person, or by the department paying for the project. The other department will not argue in the meeting. It will quietly keep its own Excel file, and the new system becomes a second system nobody trusts.
The second is to leave the glossary on a wiki and out of the code. If the column is still called is_completed, an engineer who joins six months later will use it to mean whatever they guess.
The third is to freeze the glossary. Fowler stresses that the language must evolve with the team’s understanding of the domain, so record the date each definition was settled and who approved it, then reopen it when the client’s processes change.
Turn this skill into a career advantage
In FDE job descriptions, look for phrases such as “domain modeling”, “ontology”, “semantic layer” or “work with business stakeholders”. They signal that the company needs this skill.
On a résumé, skip “communicates well with clients”. Write a line with a concrete result, such as having settled a set of metric definitions with three departments and eliminated the gap between the dashboard and the accounting books.
For interviews, prepare a story about a term that two departments understood differently: how the mismatch was discovered, which edge cases you asked about, and where the final definition lives in the system. It shows that you can work with both data and people, as the role demands.
Exercise: one status column, one afternoon
Open an orders or customers table you work with, run SELECT DISTINCT on the status column and list every value it contains. For each value, write an edge-case question such as “Which value does a partially refunded order carry?”
Take that list to people in two different departments, then enter the results in a five-column table like the one above. Wherever two people answer differently, you have the first row of the glossary.
Bad code can be fixed in an afternoon. A misunderstood word that has reached every table, every report and every agent answer also has to be corrected in the client’s mind, so settle its meaning before typing the first WHERE.
Was this article useful?
Thanks for the feedback!
7 sources
- Bounded Context (Martin Fowler) · 2014-01-15
- Ubiquitous Language (Martin Fowler) · 2006-10-31
- Alberto Brandolini on Domain-Driven Design and EventStorming (codecentric) · 2019-10-14
- Talk to the business (Codurance) · 2015-10-26
- Ubiquitous Language (Three Dots Labs Academy)
- dbt Semantic Layer (dbt Docs)
- Ontology overview (Palantir Foundry docs)