Analysing the Application Domain
Before deciding which entities exist, you must decide which part of the world the database is about. This lesson draws the boundary, maps the concepts inside it, and shows why every boundary decision becomes a schema decision.
Beginner
Learning objectives
- Define the universe of discourse of a database and justify its boundary
- Distinguish four kinds of domain concept: things, events, roles and classifications
- Detect synonyms, homonyms and vague terms in the domain vocabulary
- Record scope decisions and state their consequence on the schema
- Describe how the domain changes over time, and which changes the database must remember
Prerequisites
- Collecting Requirements
- Functional and Non-Functional Requirements
Introduction
Between the requirements document and the first E-R diagram there is a step that no notation can perform for you: deciding what the database is about. Not "which tables", not "which entities" — those are later questions. First: which portion of the world does this system have to remember?
That portion has a name in the literature. It is the universe of discourse, and drawing its boundary is the single most consequential act of the whole design.
Universe of discourse
The universe of discourse (or application domain) is the part of the real world that the database must represent: the objects, events, people, rules and relationships about which the organisation needs to store facts. Everything outside the boundary is, by decision, not the database's business.
The definition sounds academic; the practice is brutal, because the boundary is not given, it is chosen, and every choice has a cost.
A library database that includes suppliers must model purchase orders, prices and deliveries. One that excludes suppliers must still answer "where did this book come from?", so the information migrates into a free-text field — cheaper now, unusable later. Neither decision is wrong. What is wrong is not taking the decision, and discovering the boundary by accident, one missing column at a time.
The four kinds of concept
Domain analysis becomes much easier once you notice that domain concepts are not all of the same kind. Four kinds appear in almost every application, and they behave differently in the conceptual model.
| Kind | What it is | Library examples | How it usually ends up |
|---|---|---|---|
| Thing | Something with an identity that persists | Book, copy, member, branch, shelf | An entity |
| Event | Something that happens at a time and is remembered | Loan, return, reservation, payment, fine | An entity (an event is a thing with a date) |
| Role | The way a thing participates in an event | Borrower, lender, author, supervisor | A relationship, or a participation with a role name |
| Classification | A category used to group things | Genre, membership type, loan status | An entity, an attribute, or a generalisation |
The distinction matters because beginners tend to model everything as a thing, producing entities such as BORROWER that duplicate MEMBER, and because they tend to model events as attributes, producing a loan_date column on the member and thereby forbidding a second loan.
Things that look like attributes but are not
Three recurring cases deserve names, because they are the source of most conceptual errors in student projects.
1. The multi-valued attribute in disguise. "The member's phone numbers" — a member may have several. As a single column it becomes a comma-separated string; as a concept it is a separate relation. Ask: can there be more than one, and does the number of them matter?
2. The attribute that is really an entity. "The book's author" — an author has a name, a nationality, a birth date, and writes several books. Modelling it as a text column makes "find all books by this author" a string search, which fails the moment the name is spelled differently.
3. The classification that changes over time. "The member's category" — a student becomes staff. If the category is a column, history is lost; if it is a relationship with a validity period, history survives. Ask: does anyone need to know what the category was last year?
Mapping the domain
Domain analysis produces a concept map: an informal inventory of the domain's concepts, grouped by kind, with the vocabulary the organisation actually uses. It is not a diagram with cardinalities; it is the raw material for one.
Here is the map for the library, built from the interview extract of the first lesson plus the documents collected.
| Group | Concepts | Notes from the domain |
|---|---|---|
| Physical things | Book (title), Copy (physical item), Shelf, Branch | The librarian says "book" for both; the distinction is essential |
| People | Member, Librarian, Director, Supplier | A member and a supplier can be the same person |
| Events | Loan, Return, Reservation, Fine, Purchase | Each has a date and participants |
| Roles | Borrower, Lender, Author, Editor | Authors are not users of the system |
| Classifications | Genre, Membership type, Loan state, Language | Genre is a hierarchy: fiction → novel, crime |
| Documents | Catalogue record, Membership card, Loan slip | Some are outputs, some are inputs |
| Places and times | Opening hours, Loan duration, Reservation expiry | Rules expressed with time |
Two things are visible immediately in this table, and both are the point of doing it before drawing anything:
- "Book" is two concepts. The title (one catalogue record, many physical copies) and the copy (one barcode, one shelf, one condition). A schema with a single
BOOKentity cannot answer "do we have this book available?", only "do we own it?". - "Member" and "supplier" may be the same person. Whether they are one entity with two roles or two entities is a boundary decision with real consequences, and it must be taken deliberately.
The vocabulary problem
The same word means different things to different people, and different words mean the same thing. Both destroy a schema if they are not resolved before modelling.
Synonyms: different words, one concept
| Word used | By whom | Same concept? |
|---|---|---|
| "socio", "utente", "lettore", "iscritto" | Librarian, director, website, regulation | Almost certainly yes — but "utente" may also mean a system user |
| "prestito", "noleggio" | Desk staff, marketing | Same event, different tone |
| "volume", "copia", "esemplare" | Catalogue, desk, warehouse | "Copia" and "esemplare" yes; "volume" sometimes means the title |
The resolution is one canonical term per concept, recorded in the glossary, with the rejected synonyms listed. Every later artefact uses the canonical term only.
Homonyms: one word, several concepts
This is the more dangerous case, because it produces a single entity where two are needed.
| Word | Meaning 1 | Meaning 2 | Consequence if confused |
|---|---|---|---|
| "cliente" | A person who buys | A company that buys | One table with half-empty columns, or a lost relationship to a contact person |
| "ordine" | A customer order | A purchase order to a supplier | Two different lifecycles in one table |
| "conto" | A bank account | A restaurant bill | Nonsense |
| "corso" | A course as a programme | A course edition in a year | Enrolments attached to the wrong thing |
Scope decisions and their consequences
Every scope decision is a small contract, and it must be written with its consequence. A scope table is the most useful page in the domain analysis document.
| # | Concept | In scope? | Why | Consequence on the schema |
|---|---|---|---|---|
| S1 | Physical copies | Yes | Availability questions are the core of the service | COPY as an entity; loans refer to a copy, not a title |
| S2 | Suppliers and purchases | No, this release | The acquisition office keeps its own system | No SUPPLIER; the acquisition reference becomes a text field — recorded as a known limitation |
| S3 | Payments of fines | Yes | Fines are collected at the desk | PAYMENT as an event related to FINE |
| S4 | Room bookings | No | Different service, different users | Nothing; explicitly out of scope in the document |
| S5 | Reading history for recommendations | Yes, anonymised | Requested by the director | Loans are retained beyond return, with personal data anonymised after 5 years |
| S6 | Interlibrary loans | Yes | The regulation requires it | A LOAN may reference a partner library; a new entity PARTNER_LIBRARY |
Two lessons are visible in this table.
First, "no" has a consequence too. Excluding suppliers does not remove the information need; it moves it into an unstructured field. Recording that move is what makes the limitation honest, and it is also what makes it revisitable: when the acquisition office is integrated in two years, the design document already says where the information went.
Second, a scope decision can be about granularity, not about presence. S5 does not say "keep history or not"; it says "keep history, but anonymised after five years". That is the decision that, as the previous lesson showed, changes the shape of the schema rather than adding a feature.
The temporal dimension
Most domain concepts change over time, and the database must be explicit about which changes it remembers. This is not a detail of Module 5; it is a property of the domain that must be described here.
| Kind of change | Example | Design question |
|---|---|---|
| Value changes, history irrelevant | A member's phone number | Current value only — a column is enough |
| Value changes, history required | A copy's condition, a book's price | A history relation, or a validity period |
| State changes with a lifecycle | A loan: active → returned → overdue | A state attribute plus the dates of each transition |
| The thing ends | A membership expires; a member leaves | Retention policy: keep the row, mark it inactive, or archive it |
| Relationships change | A member changes branch | Does the old relationship matter? If yes, it needs dates |
What the analysis produces
The domain analysis produces four artefacts, all of them prose and tables — no diagrams with cardinalities yet.
- The domain description — two to five pages of prose describing how the organisation works: what it does, who does it, which documents exist, which rules apply. Written for a reader who does not know the organisation.
- The concept map — the inventory of concepts by kind, with the organisation's own vocabulary.
- The glossary — one canonical term per concept, with synonyms and rejected meanings. (Detailed in its own lesson.)
- The scope table — what is in, what is out, why, and the consequence of each decision.
Together these make the next phase mechanical rather than creative. Choosing entities is still a judgement call, but it is a judgement about a known inventory rather than about a blank page.
Worked example: from description to concept map
Here is a short domain description, of the kind you would write after two interviews.
The library has three branches. Each branch has shelves, and each copy of a book is placed on exactly one shelf. The catalogue is shared: a title is recorded once, with its authors, publisher, year, language and genre, and the library owns one or more copies of it. Copies are bought from suppliers, but acquisitions are managed by a separate office and are not part of this system. Members are registered at one branch; students pay a reduced fee and may borrow for 30 days, staff for 60. A member may reserve a title when no copy is available; the reservation is served by the first copy returned to any branch. Fines are charged at 0.20 € per late day, capped at the price of the copy, and are paid at the desk.
Read it and extract:
| Kind | Concepts found | Evidence in the text |
|---|---|---|
| Thing | Branch, Shelf, Copy, Title, Member | "three branches", "each copy … on exactly one shelf" |
| Event | Loan, Reservation, Fine, Payment | "borrow for 30 days", "reserve a title", "fines are charged", "paid at the desk" |
| Role | Borrower, Author, Publisher, Supplier | "with its authors", "bought from suppliers" |
| Classification | Genre, Membership type, Language | "genre", "students … staff" |
| Out of scope | Supplier, Purchase | "acquisitions … are not part of this system" |
| Rule with a number | Loan duration, fine rate, cap | "30 days", "60 days", "0.20 €", "capped at the price" |
Now look at what the description already settles, and what it leaves open.
Settled by the text: a copy is on exactly one shelf (a functional relationship); a title is shared across branches (the catalogue is global); a reservation is on a title, not on a copy ("reserve a title … served by the first copy returned to any branch"); fines have a rate and a cap.
Left open — and these are the questions to ask now:
- Can a member be registered at more than one branch? The text says "registered at one branch" — but is that a rule or an accident of the current system? If it can change, the registration becomes a relationship with a start date.
- Is the fine rate the same for all membership types? Not stated. If it differs, the rate becomes an attribute of the classification.
- When a copy is transferred between branches, is the shelf updated or is the transfer remembered? Not stated, and it decides whether shelf placement is a simple attribute or an event.
- What happens to a reservation when the member's membership expires? Not stated. It is a business rule that will otherwise be discovered in production.
Common mistakes
| Mistake | Why it hurts | What to do instead |
|---|---|---|
| Starting from the current database schema | Reproduces its accidents as requirements | Describe the domain first; compare with the old schema afterwards |
| Treating "book" as one concept | Cannot answer availability questions | Distinguish title from physical copy |
| Modelling events as attributes | Forbids a second occurrence | Ask whether the event repeats and must be remembered |
| Ignoring synonyms and homonyms | Two entities where one is needed, or one where two are needed | Glossary with canonical terms |
| Leaving scope implicit | The boundary moves silently during implementation | Scope table with consequences |
| Forgetting the temporal dimension | History is overwritten and cannot be reconstructed | Ask, per attribute: must we know its previous value? |
| Drawing before inventorying | Cardinalities committed too early | Concept map first |
| Describing the software instead of the domain | The model mirrors the screens | Describe the work, not the interface |
Summary
- The universe of discourse is the part of the world the database must remember; its boundary is chosen, and every choice has a cost.
- The boundary test: will anyone ask a question whose answer requires this concept?
- Domain concepts come in four kinds — things, events, roles and classifications — and confusing them produces duplicated entities or lost occurrences.
- Synonyms and homonyms must be resolved before modelling; a homonym left unresolved becomes a table that cannot be fixed without migrating every row.
- Scope decisions are recorded with their consequences, including the consequences of exclusion.
- The domain has a temporal dimension: for every attribute that changes, someone must decide whether its previous values matter.
- The output of this phase is prose, an inventory, a glossary and a scope table — no cardinalities yet.
Verification questions
Check your understanding
- What is the universe of discourse, and who decides its boundary?
- Why is a loan an entity rather than an attribute of the member?
- Give an example of a homonym in a domain you know, and state the schema consequence of confusing the two meanings.
- Why does excluding a concept from scope still leave a trace in the schema?
- What question must be asked about every attribute that can change over time?
Show the answers
- It is the portion of the real world the database must represent. The boundary is decided jointly by the designer and the organisation — the designer proposes, the owner decides — and the decision is recorded in the scope table with its consequences.
- Because a member can borrow many times, and each occurrence has its own date, due date, copy and return. As an attribute it could hold only the latest loan, losing history and forbidding concurrent loans. The test: can it happen more than once, and must each occurrence be remembered?
- Examples: "cliente" (person versus company), "ordine" (customer order versus purchase order), "corso" (programme versus edition). Consequence of confusion: a single relation holding two different lifecycles, with half the columns empty for each type, and queries that must guess which kind of row they are reading.
- Because the information need does not disappear — it moves. Excluding suppliers leaves "where did this copy come from?" answered by a free-text field, which is a design decision with a known limitation, not the absence of a decision.
- Must we know what the value was before? If yes, the attribute cannot be a plain column: it needs a history relation or a validity interval, and that is a structural difference decided here, not in Module 5.
Exercise
Map a domain you know
Consider a gym. Members subscribe to plans, book classes, and are taught by instructors. Classes happen in rooms at fixed times. Members may freeze their subscription.
Produce:
- A concept map with at least twelve concepts, grouped by kind.
- Three homonyms or synonyms likely to appear in the organisation's vocabulary, with the ambiguity explained.
- A scope table with four decisions, two inclusions and two exclusions, each with its consequence on the schema.
- Two open questions that the description above leaves unanswered, and why each one changes the schema.
Show the commented solution
1. Concept map
| Kind | Concepts |
|---|---|
| Thing | Member, Plan, Class (type), Session (a class at a time), Room, Instructor, Subscription, Payment |
| Event | Booking, Attendance, Freeze, Payment |
| Role | Attendee, Instructor-of-session, Subscriber |
| Classification | Plan type, Class category, Booking state |
The critical distinction is Class versus Session: "yoga" is a class type; "yoga, Tuesday 18:00, room 2, with Anna" is a session. A schema that models only the class cannot record bookings, because bookings are for a specific time. This is the same title-versus-copy distinction as the library, in different clothes — which is exactly why the four kinds are worth learning: the patterns repeat.
2. Ambiguities
- "Iscritto" — a person with an active subscription, or a person registered in the system who has stopped paying? If both, the schema needs a membership state, not a boolean.
- "Corso" — the class type (yoga) or the scheduled session? If confused, bookings attach to a type and the room and time are lost.
- "Abbonamento" — the plan (monthly, annual) or the specific subscription of a specific member with its start and end dates? If confused, prices change retroactively for everyone.
3. Scope table
| # | Concept | In? | Why | Consequence |
|---|---|---|---|---|
| S1 | Room capacity | Yes | Bookings must be refused when full | capacity on ROOM; a check at booking time |
| S2 | Instructor payroll | No | Handled by the accountant | No salary data; a known limitation recorded |
| S3 | Subscription freezes | Yes | Requested by the owner; affects expiry dates | FREEZE as an event with start and end; the expiry is computed, not stored |
| S4 | Medical certificates | No, this release | Sensitive data, separate process | No storage; the rule "no certificate, no access" is enforced outside the system — recorded |
4. Open questions
- Can a member book two sessions of the same class on the same day? If not, the booking relation needs a uniqueness constraint over (member, date, class) — a structural constraint, not a validation message.
- What happens to future bookings when a subscription is frozen? If they are cancelled, cancellation is an event that must be recorded; if they are kept, the freeze must not affect them. Either answer changes the schema, and neither can be guessed.
Why this exercise matters. Note that in both the library and the gym, the decisive distinctions were type versus occurrence (title/copy, class/session, plan/subscription) and state over time (freeze, expiry, overdue). Recognising these two patterns is most of domain analysis.
Where to go next
- How the concepts of this lesson become candidate entities: Finding Candidate Entities.
- The vocabulary discipline this lesson demands, in full: Requirements Analysis.
- The architecture that separates what the domain means from how it is stored: The ANSI/SPARC Three-Level Architecture.
- A complete worked example with entities, attributes and cardinalities: Student and Course.