Skip to content

Latest commit

 

History

History
115 lines (84 loc) · 3.78 KB

File metadata and controls

115 lines (84 loc) · 3.78 KB

Experiment 6: Identifying Domain Classes from Problem Statements

← Back to Index


Aim

To identify domain classes and their relationships from a given problem statement using object-oriented analysis.


Theory

Domain class identification is a core activity in Object-Oriented Analysis (OOA). A domain class represents a real-world concept in the problem domain.

Techniques to Find Classes

Technique Description
Noun Extraction Identify all nouns in the problem statement as candidate classes
Category List Look for physical objects, roles, events, organizations, containers
CRC Cards Class-Responsibility-Collaboration cards define class behavior

Nouns to Keep vs. Discard

Keep Discard
Real-world objects Vague terms (e.g., "system", "data")
Roles (User, Admin) Implementation concepts (e.g., "database", "array")
Events (Order, Booking) Synonyms / duplicates
Containers (Cart, Folder) Attributes of other classes

CRC Card Format

+---------------------------+---------------------------+
|  Class Name               |  Collaborators            |
+---------------------------+---------------------------+
|  Responsibilities:        |  - OtherClass1            |
|  - What it knows          |  - OtherClass2            |
|  - What it does           |                           |
+---------------------------+---------------------------+

Procedure

  1. Read the problem statement carefully and highlight all nouns.
  2. Remove redundant, vague, or implementation-specific nouns.
  3. Classify remaining nouns as candidate domain classes.
  4. For each class, identify its responsibilities (what it knows/does).
  5. Identify collaborators (which other classes it interacts with).
  6. Create CRC cards for each domain class.
  7. Define attributes and operations for each class.
  8. Draw a simplified domain model showing all classes and relationships.
  9. Validate domain model against the original problem statement.

Example

Problem Statement: "A hospital management system allows doctors to manage patient records. Patients can book appointments. Nurses assist doctors. Bills are generated after treatment. Each patient is assigned to a ward."

Step 1: Noun Extraction

hospital, doctor, patient, records, appointment, nurse, bill, treatment, ward, system

Step 2: Filtered Domain Classes

Class Reason Kept
Patient Core real-world entity
Doctor Role with behavior
Appointment Key event/transaction
Nurse Role with behavior
Bill Transaction entity
Ward Physical container

Discarded: "hospital" (too broad), "records" (attribute), "treatment" (activity)

Step 3: CRC Cards

Patient

Responsibilities Collaborators
Store personal & medical details Doctor
Book / cancel appointments Appointment
View bills Bill, Ward

Doctor

Responsibilities Collaborators
Manage patient records Patient
Conduct appointments Appointment
Prescribe treatment Nurse, Bill

Appointment

Responsibilities Collaborators
Store date, time, status Patient
Confirm / cancel appointment Doctor

Step 4: Domain Model

[Patient] ——books——→ [Appointment] ←——conducts—— [Doctor]
    |                                                  |
    | assigned to                               assisted by
    ↓                                                  ↓
 [Ward]                                            [Nurse]
    
[Bill] ←——generated for—— [Patient]