Requirements Analysis

Finding Candidate Entities

Every noun in a requirements document looks like a table. Most of them are not. This lesson gives a repeatable procedure for deciding which concepts deserve to become entities, and which are attributes, events or plain values in disguise.

Beginner

Learning objectives

  • Apply the noun-phrase extraction procedure to a requirements text
  • Test each candidate against identity, independent existence, multiplicity and relevance
  • Distinguish an entity from an attribute using the decisive test
  • Separate a type from its occurrences (title and copy, class and session)
  • Decide whether a concept is an entity, an event, or an attribute of an association
  • Produce a candidate entity list with definitions, provisional identifiers and open questions

Prerequisites

  • Analysing the Application Domain
  • Functional and Non-Functional Requirements

Introduction

The domain analysis of the previous lesson produced a concept map: things, events, roles, classifications. That map is a picture of the vocabulary. It is not yet a schema, and the distance between the two is exactly where beginner designs fail.

Here is the trap. Ask a group of students to list the entities in a library system and you will get:

Book, Member, Loan, Author, Publisher, Category, Copy, Fine, Reservation, Librarian, Shelf, Address, Phone Number, Email, Age, Total Loans.

Thirteen items. Three of them are not entities. Two of them are the same thing twice. Four of them are attributes. One of them is an event that has been promoted to a thing without a reason. And two entities that must exist are missing entirely, because nobody said their name out loud.

The problem is not that the list is wrong. The problem is that nothing in the list says why each item is there, so nothing can be checked, argued or corrected. A candidate entity list without reasons is a guess with formatting.

This lesson replaces guessing with a procedure. The procedure is mechanical enough to apply to any text, and it is the same one professional designers apply — they simply run it faster.

What an entity actually is

Before testing candidates, the target must be precise.

Entity

An entity is a class of objects of the application domain that share a common meaning and are described by the same properties. Each individual object belonging to the class is an instance (or occurrence) of the entity.

Member is the entity; the person with card number 4471 is an instance. Book is the entity; The Name of the Rose, copy 2, is an instance.

Two consequences follow immediately, and both are routinely ignored.

First: an entity is a class, not a single object. A schema for a library with exactly one member still has a Member entity. The model describes the kind of thing the database must hold many of, or must be able to hold many of in the future.

Second: instances must be distinguishable. If two instances cannot be told apart — if there is no fact about one that is not also true of the other — then the concept is not being modelled at the right granularity, or it is not an entity at all. This is why identity is the first test, not the last.

Entity versus instance, in one line

The entity is the mould; the instance is what comes out of it. Book does not have a title; a book has a title. Confusing the two produces sentences like "the Book table stores 12,000 rows", which mixes a schema object with data.

The four tests

Every candidate extracted from a requirements text must pass four tests. A candidate that fails any of them is not an entity — though it may still be something else worth keeping.

# Test Question If it fails
T1 Identity Can I tell two instances apart, and does the organisation need to? It is a value, a measurement or an attribute
T2 Independent existence Does it exist, and can it be referred to, on its own? It is an attribute of something else, or part of a composite value
T3 Multiplicity Can there be many of them, now or later? It is a single configuration value, not an entity
T4 Relevance Does at least one requirement force the database to remember it? It is out of scope (record the decision, then drop it)

Test T1 — Identity

The organisation must be able to say "this one, not that one".

  • Book passes: a reader asks for a specific title, and the library holds several.
  • Colour of the cover fails: two books with the same colour are not distinguished by it. It is an attribute.
  • Fine passes, but only because each fine has a date, an amount and a reason. If the requirement were only "does this member owe money?", the answer is a flag on the member, not an entity.

Identity is not the same as having a name. A loan has no name; it is identified by which copy was lent to which member when. That is an identity, expressed by a combination — which is exactly the kind of thing the conceptual model must record, and which the relational model will later turn into a key.

Test T2 — Independent existence

Ask: can this thing be referred to without naming the thing it belongs to?

  • Copy passes: "copy 3 of The Name of the Rose" is a thing in its own right, with its own acquisition date and condition.
  • Street address of a member fails: it exists only as part of the member's address. It is a composite attribute, not an entity.
  • Order line is the interesting middle case: it does not exist without an order, and yet it has its own attributes (quantity, unit price at the time of sale) and must be distinguishable from the other lines of the same order. In E-R terms this is a weak entity — an entity whose identity depends on another. It passes T2 in the weak sense and will be modelled in Module 3.

Test T3 — Multiplicity

If the answer to "can there be many?" is permanently no, the concept is configuration, not data.

  • A library has one name and one opening time. Those are settings, not entities.
  • A library has many branches. Branch is an entity.
  • A company has one VAT number. A group of companies has many. The test is about the domain as it will plausibly evolve, not about today's paperwork.

Test T4 — Relevance

This is the test people skip, and it is the one that keeps the schema honest.

A concept passes T1–T3 but no requirement ever asks about it. Supplier's bank details pass the first three tests and fail the fourth if nobody will ever pay a supplier from this system.

Failing T4 is not a failure of the candidate; it is a scope decision, and it must be written down with its consequence, exactly as the scope table of the previous lesson prescribed. "Suppliers are out of scope in this release; purchase prices will be recorded as free text on the copy" is a professional sentence. Silently omitting suppliers is not.

The decisive test: entity or attribute?

This is the question that decides most schemas, and it has a clean answer.

The entity-versus-attribute test

A concept must be modelled as an entity when at least one of these is true:

  1. It has its own attributes that are not attributes of the thing that mentions it.
  2. It is shared: the same instance is referred to by many other instances.
  3. It has its own lifecycle: it is created, modified and retired independently.
  4. It must be counted, listed or reported on on its own.

If none of the four holds, it is an attribute of the concept that mentions it.

Apply it to the library list.

Candidate Own attributes? Shared? Own lifecycle? Reported alone? Verdict
Author Yes: name, birth year, nationality Yes: many books per author Yes Yes Entity
Publisher Yes: name, city, contact Yes Yes Yes Entity
Category Barely: a name and a description Yes Rarely Yes Entity, but a small one
Shelf Yes: code, room, capacity Yes Yes Yes Entity
Address No, it is a set of parts No No No Composite attribute
Phone number No No No No Multivalued attribute
Email No No No No Attribute
Age No — and it is derivable from the birth date No No No Derived attribute, and a bad one to store
Total loans of a member No — it is a count of loans No No Sometimes Derived attribute, or nothing at all

Two rows deserve a comment.

Category is the borderline case every designer meets. It has almost no attributes of its own, and yet it is shared, has its own lifecycle ("we retired the Poetry category in 2023") and is reported on. The four tests answer it cleanly: shared + own lifecycle → entity. A designer who argues from "it is only one field" is arguing from the wrong criterion.

Age fails everything, and it fails twice: it is not a property of the member in the way a name is, because it changes every year without anyone editing the record. Storing it guarantees that the stored value will eventually disagree with the birth date. It is a derived attribute, and in a good schema derived attributes are either computed on demand or not modelled at all.

The type/occurrence split

If this lesson teaches one thing worth remembering, it is this. Most modelling failures in student projects are not about entities being wrong. They are about one concept being asked to play two roles: the kind of thing, and the specific thing.

Type and occurrence

A type is a category or specification: The Name of the Rose, yoga class, the monthly plan, the Toyota Corolla model.

An occurrence is a specific, identifiable individual of that type: copy 2 of The Name of the Rose, the yoga session on Tuesday at 18:00, Anna's subscription from March to June, the car with plate AB123CD.

They are different entities with different attributes, and merging them destroys information that cannot be recovered later.

The pattern repeats across domains with almost mechanical regularity.

Domain Type Occurrence What is lost if merged
Library Book (title) Copy Which physical copy is lent, damaged, lost
Library Subscription plan The member's subscription Start and end dates, price paid
Gym Class (yoga) Session (Tuesday 18:00) Bookings, room, instructor
Retail Product Stock item / lot Stock levels, expiry, location
Car rental Vehicle model Vehicle (plate) Availability, mileage, damage
Airline Flight number Flight on a date Seats, delays, crew
Hospital Doctor Appointment slot Availability, room, duration
University Course Course edition (year) Enrolments, teacher, timetable

The test that separates them is always the same question: does the thing have facts that the type cannot have?

The Name of the Rose has an ISBN and an author. It does not have an acquisition date, a condition, or a shelf. Copy 2 has all three, and its title is one of its attributes. Conversely, a copy does not have an author — the author belongs to the title.

When a requirements document says "the library owns 12,000 books", it is counting copies. When it says "we stock 8,000 titles", it is counting types. A schema with only one of the two cannot answer the other question, and the difference between those two sentences is the whole point of this section.

Events: the third kind of candidate

A loan, a reservation, a payment, a visit, a delivery, an enrolment, an inspection. These are events: something that happens at a point or over an interval, involving other things.

Events pass the four tests easily — they have identity (by participants and time), their own attributes (date, amount, state), their own lifecycle, and they are reported on constantly. The difficulty is not whether they are entities; it is whether the requirements need the event or only its current consequence.

Requirement What it forces
"Show which copy each member currently has" A Loan entity with a state, or an on_loan flag on the copy
"Show the loan history of a member for the last three years" A Loan entity, no alternative
"Know whether a copy is available" Derivable from the loan entity; not a separate fact
"Charge 0.50 per day of delay" A Loan with due date and return date, plus the rule
"Count how many loans each member made this year" A Loan entity, and note that the count is derived

The rule that resolves this: model the event when the history matters; model the state when only the present matters. And when in doubt, model the event — a state flag can always be computed from events, while events cannot be reconstructed from a flag. The information flows one way only.

The noun-phrase procedure

Here is the mechanical part. It is deliberately dull, because dull procedures are repeatable, and repeatable procedures can be reviewed by someone else.

Step 1 — Mark every noun and noun phrase. Print the requirements text and underline them. Do not filter yet. Include the ones that sound silly: branch, condition, note, reason, preferred language.

Step 2 — Build the raw table. One row per candidate, with the sentence that produced it. The sentence is not decoration: it is the evidence you will need when someone disputes the verdict.

Step 3 — Apply T1 to T4. Record which test each candidate fails. A verdict without a failed test is an opinion.

Step 4 — Apply the entity-versus-attribute test to everything that survived. Record the four sub-answers, not just the conclusion.

Step 5 — Hunt for type/occurrence pairs. Scan the surviving list for concepts that come in a kind and a specific version. This step is not automatic; it needs the two diagnostic questions.

Step 6 — Name, define, and record what is open. Every surviving candidate gets a singular name, a one-sentence definition in the organisation's own words, a provisional identifier, and any question the requirements do not answer.

Steps 1 and 2 take ten minutes. Steps 3 to 6 take an hour, and they are the hour that saves a week.

Worked example: the library text

The requirements from the earlier lessons, in condensed form:

The library has several branches. Each branch holds a collection of books and employs librarians. A book has a title, one or more authors, a publisher, an ISBN, a category and a publication year. The library owns several physical copies of the same book; each copy has an acquisition date, a condition and a shelf location. Members register at one branch, have a card number, a name, an address with street, city and postal code, one or more phone numbers, and an email. A member can borrow up to five copies at a time, for 30 days. When a copy is returned late, a fine of 0.50 per day is charged. Members may reserve a book that is currently on loan. Librarians record loans and returns. The library wants to keep the loan history of the last three years.

Applying the procedure:

Candidate T1 identity T2 independent T3 multiple T4 relevant Verdict Reason
Branch Yes Yes Yes Yes Entity "Several branches"; loans and members belong to one
Book (title) Yes (ISBN) Yes Yes Yes Entity Shared by many copies; has author, publisher, year
Copy Yes Yes Yes Yes Entity Own acquisition date, condition, shelf; lent individually
Author Yes Yes Yes Yes Entity Shared; "one or more authors"
Publisher Yes Yes Yes Yes Entity Shared across titles
Category Yes Yes Yes Yes Entity Shared, reported on, own lifecycle
Shelf Yes Yes Yes Yes Entity Location of copies; capacity
Member Yes Yes Yes Yes Entity Card number is the identifier
Loan Yes Weak Yes Yes Entity Event with dates and state; history required
Reservation Yes Weak Yes Yes Entity Event with a queue position and a state
Fine Yes Weak Yes Yes Entity Amount, reason, paid/unpaid
Librarian Yes Yes Yes Yes Entity Records loans; needs identity to audit
Address No No No Yes Composite attribute of Member Street, city, postal code are parts, not entities
Phone number No No No Yes Multivalued attribute of Member Several per member, no attributes of their own
Email No No No Yes Attribute of Member Single valued
Publication year No No No Yes Attribute of Book A number
Acquisition date No No No Yes Attribute of Copy A date
Condition No No No Yes Attribute of Copy An enumerated value
Card number No No No Yes Identifier of Member Not a separate entity
Fine rate (0.50/day) No No No Yes Business rule / parameter Not data about members
Loan history (3 years) — — — Yes Requirement on Loan Forces Loan to be an event, and retention
"Up to five copies" — — — Yes Business rule A cardinality constraint, later
"30 days" — — — Yes Business rule Due-date rule

Thirteen entities, eight attributes, four rules. Note what the table achieved: every item has a reason, and the reasons can be argued with. Someone can say "I disagree, Shelf should be a free-text field on Copy" and the disagreement becomes a concrete, decidable discussion about whether shelves are shared and reported on. That is what a design document is for.

Note also the three events marked Weak under T2. A loan does not exist without a copy and a member, yet it has its own attributes and its own identity over time. These are the weak entities and event entities that Module 3 will model properly; at this stage it is enough to know they are entities and not attributes.

Naming: the cheapest quality signal

Names are not cosmetic. A schema whose entity names are wrong is a schema that will be misunderstood, and misunderstanding is where defects come from.

Bad name Problem Better Why
tbl_member Implementation detail leaked into the conceptual model Member Conceptual names describe the domain, not the storage
Members Plural Member An entity names the class; instances are many
MEMBER SQL convention Member Casing is a physical decision
Borrower A role, not the thing Member The member is a borrower only while borrowing; the role belongs to the relationship
BookCopy Two concepts glued together Copy If the domain says "copy", use "copy"
Data, Info, Record Meaningless — A name that fits everything identifies nothing
FineCalculation A process Fine Processes are not entities; their results are
isOverdue A predicate Loan with due and return dates The predicate is derivable

Four rules cover almost everything:

  1. Singular, because the entity is a class.
  2. Domain language, because the schema is a contract with the organisation, not with the programmer.
  3. A noun that is not a role and not a process, because roles and processes are modelled elsewhere.
  4. Stable, because renaming an entity after the relationships exist is expensive.

The candidate entity list as a deliverable

The output of this lesson is not a diagram. It is a table that the diagram will later be derived from, and that a reviewer can check line by line.

Column Content
Name Singular, domain language
Definition One sentence, in the organisation's words, saying what one instance is
Why an entity The test(s) it passes, or the requirement that forces it
Provisional identifier The fact that will distinguish instances (may be composite)
Type or occurrence Which of the two, and its counterpart
Scope reference The requirement ID that justifies it
Open questions What the requirements do not answer

A filled row:

Copy — One physical exemplar of a title held by a branch. Why: own attributes (acquisition date, condition, shelf), individual lending. Identifier: the copy number within the title, or a barcode. Occurrence of Book. Requirements: F3, F7. Open: are lost copies kept in the catalogue, and in which state?

That row will be reviewed, disputed and corrected. That is the point. Compare it with a bare bullet "Copy" in a list of thirteen nouns, which can only be accepted or rejected as a whole.

Common mistakes

Mistake What it looks like Why it hurts Fix
Treating every noun as an entity A schema with 25 entities for a small library Endless joins, no clear model Apply the entity-versus-attribute test
Treating every attribute as an entity City, PostalCode, Colour tables Pointless joins; a schema that models the dictionary Shared + own lifecycle + reported on, or it is an attribute
Merging type and occurrence Book with a copy_number column Cannot represent two copies lent to two members Split into Book and Copy
Modelling the process, not its result Borrowing, Calculation, Registration Nothing to store; the model describes verbs Model the event or the state that results
Using a role as an entity name Borrower, BorrowedBook Roles belong to relationships Name the thing; express the role in the association
Storing derived facts age, total_loans, available Guaranteed to drift out of sync Compute, or model the events
Omitting an entity nobody named No Branch, although loans happen in branches The requirement cannot be met at all Walk the requirements sentence by sentence
Verdicts without reasons A bullet list of nouns Unreviewable; errors survive to the diagram The seven-column table

Summary

  • An entity is a class of domain objects described by the same properties; an instance is one of them. The model describes classes, not rows.
  • Four tests classify every candidate: identity, independent existence, multiplicity, relevance. A candidate that fails a test is not thereby useless — it is something else.
  • The entity-versus-attribute test has four clauses: own attributes, shared, own lifecycle, reported on. Any one is enough to make it an entity; none means it is an attribute.
  • The type/occurrence split is the most frequent and most expensive modelling error. Ask "how many do we have?" and "what is it?" — if the answers differ, there are two entities.
  • Events are entities. Model the event when history matters, the state when only the present matters, and remember that a flag is a decision to forget.
  • The noun-phrase procedure is six mechanical steps ending in a table where every verdict carries its reason.
  • Names are a quality signal: singular, domain language, not a role, not a process, stable.

Verification questions

1. A hairdresser's booking system has the concepts service, appointment, hairdresser, chair, price and duration. Classify each as entity, attribute or rule, and justify with the four tests.

Show the solution
  • Service — entity. Shared (a haircut is sold many times), own attributes (duration, price), own lifecycle (the price list changes), reported on (revenue by service). Passes all four.
  • Appointment — entity, and an event. Identity by hairdresser, client and time; own attributes (state, notes); reported on (occupancy, no-shows). Fails T2 only in the weak sense.
  • Hairdresser — entity. Identity (a person), shared (many appointments), own lifecycle, reported on (workload).
  • Chair — entity, but only if chairs are a limited resource that must be assigned. If the requirement is merely "three chairs in the shop", it fails T1 (two chairs are not distinguished by anything) and becomes a capacity figure. This is the T4-driven borderline case: ask whether the organisation will ever need to know which chair.
  • Price — attribute of Service. It is a single value per service, with no identity, no sharing and no lifecycle of its own. If the requirement includes price history, then price becomes an event-like entity (a price valid from a date), which is a genuinely different requirement.
  • Duration — attribute of Service, by the same reasoning.

2. Why is Book with a copy_number column a design error, and what information is destroyed?

Show the solution

Because it merges a type and an occurrence into one entity. The Book row then represents a title, and copy_number can hold only one value — so a title with four copies needs four rows, each repeating the ISBN, title, author and publisher. That is redundancy, and it is the smallest problem.

The destroyed information is the ability to say which physical copy was lent, returned damaged, lost or moved to another branch. With four duplicate Book rows there is no stable identity for a copy: if a row is deleted, the history attached to it goes with it, and if two rows describe the same title nobody can tell whether they are two copies or a data-entry mistake. Acquisition dates, conditions and shelf locations all become ambiguous — they attach to a row that is sometimes a title and sometimes a copy.

The correct model is Book (title-level facts: ISBN, title, publisher, year, category, authors) and Copy (copy-level facts: acquisition date, condition, shelf, state), with a one-to-many relationship. The two questions "how many titles?" and "how many copies?" then both have answers.

3. A requirement says: "the system must show whether a copy is currently available." Does that require a Loan entity?

Show the solution

Not by itself. Availability is the negation of "there is an active loan for this copy", so it is derivable from the loan data. If the loan entity exists for other requirements — and in a library it almost always does, because history and fines are required — availability is a query, not a stored fact.

But consider the case where no other requirement forces loans: a small tool that only answers "is it on the shelf?". Then the honest model is a state attribute on the copy. That is cheaper and correct for that requirement set.

The trap is doing both: storing is_available and keeping loans. The two will disagree as soon as one update path forgets the flag. Either derive it, or store it as the single source of truth — never both.

Exercise

Intermediate

A veterinary clinic

Read the description and produce the seven-column candidate entity list. Decide the verdict for every candidate and write the reason.

A veterinary clinic treats animals. Each animal has a name, a species, a breed, a date of birth and a weight recorded at each visit. Every animal has one or more owners; an owner may own several animals. Owners have a name, a tax code, an address, a phone number and an email. The clinic employs veterinarians, each with a registration number and a specialisation. An owner books a visit for an animal with a specific veterinarian on a date and at a time. During a visit the veterinarian records a diagnosis, a therapy and, if needed, a prescription. A prescription contains one or more drugs, each with a name, an active ingredient and a dosage. The clinic wants to know the complete clinical history of every animal, and to know which drugs were prescribed most often last year. Vaccinations are recorded with the vaccine name, the date and the next due date.

Pay particular attention to: weight, prescription, drug, dosage, vaccination, and the difference between species and breed.

Commented solution

Entities

Name Definition Why an entity Provisional identifier Type/occurrence Open questions
Animal A patient of the clinic Own attributes, own lifecycle, reported on Microchip, or clinic record number — Can an animal change owner? If yes, ownership is an event, not a link
Owner A person legally responsible for one or more animals Own attributes, shared across animals Tax code — Are owners also patients' contacts for billing?
Veterinarian A clinician employed by the clinic Own attributes, shared across visits Registration number — Can a vet be external (a consultant)? If yes, add a type
Visit A clinical encounter between an animal and a vet at a time Event: dates, diagnosis, therapy; history required Animal + date + time — Can two vets see the same animal in one visit?
Prescription The set of drugs prescribed in one visit Own attributes (date, state); reported on Visit + progressive number — Can a prescription be renewed without a new visit?
Drug A medicinal product that can be prescribed Shared across prescriptions, own attributes, reported on Name + active ingredient, or a code Type Are drugs stocked? If yes, a StockItem occurrence is needed
Vaccination An administration of a vaccine to an animal Event with its own date and next due date Animal + vaccine + date — Is the vaccine a Drug? If it is, this is a specialisation
Species The biological species of an animal Shared, reported on (statistics by species) Name Type —
Breed A breed within a species Shared, belongs to one species Name + species Type, dependent on Species Is breed ever unknown? Then it must be optional

Attributes, not entities

Candidate Verdict Reason
Weight Attribute of Visit Recorded at each visit, so it belongs to the visit, not to the animal. Storing a single weight on the animal would lose the trend — and the trend is the clinical signal. This is a classic case where the sentence "at each visit" moves an attribute to a different entity.
Dosage Attribute of the prescription line It depends on both the prescription and the drug; it is not a property of the drug alone
Diagnosis, therapy Attributes of Visit Free text at this stage; if coded diagnoses are required, Diagnosis becomes an entity
Name of the animal, date of birth Attributes of Animal Single valued
Tax code, address, phone, email Attributes of Owner Phone may be multivalued if the requirement says "numbers"
Specialisation Attribute of Veterinarian Single valued; becomes an entity only if specialisations are shared, listed and reported on
Active ingredient Attribute of Drug Single valued; becomes an entity if drugs are searched by ingredient
Next due date Attribute of Vaccination Derived from the date and the vaccine's validity, so record the rule

The two questions that decide the exercise

Weight is the trap. It looks like an attribute of Animal and is actually an attribute of Visit. The sentence "recorded at each visit" is the whole requirement, and a schema with a single weight column cannot answer "is this animal losing weight?".

Species and breed form a genuine type hierarchy: a breed belongs to exactly one species, and species is reported on independently. Modelling both is correct. Modelling only breed loses the species statistics; modelling only species loses the breed, which owners and vets care about. Note that Breed is a dependent entity — its identity is only meaningful within a species — which is a preview of the weak-entity concept.

One more thing the list reveals

Nothing in the list models who pays. Invoicing is not mentioned in the requirements, so it fails T4 and is out of scope — but the decision must be recorded, because the moment the clinic asks "which owner owes us money?", a new entity appears and the owner-animal relationship acquires a financial dimension it currently does not have.

Where to go next

Related lessons