25-Comp-B11 Advanced Software Design · December 2018
Question 4 of 28: Deriving OOD Classes from a Use Case Diagram
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer) · Last updated
Notes on this paper
Reference texts: Sommerville, Software Engineering (10th ed., Pearson) — software processes, requirements engineering, design principles, dependability; Pressman, Software Engineering: A Practitioner's Approach (9th ed.) — supplementary process and quality coverage; Gamma, Helm, Johnson & Vlissides (GoF), Design Patterns: Elements of Reusable Object-Oriented Software — creational/structural/behavioural pattern catalogue and the "program to an interface, not an implementation" / "favor object composition over class inheritance" principles; Sebesta, Concepts of Programming Languages (12th ed.) — polymorphism, dynamic binding, inheritance and language-level object semantics; Bertrand Meyer, Object-Oriented Software Construction — design by contract, preconditions/postconditions/invariants; Barbara Liskov's 1987 substitutability paper for Question 11; Karl Wiegers, Software Requirements (3rd ed.) — the functional/quality/process/implementation/business requirements taxonomy of Question 2; Kruchten, The Rational Unified Process: An Introduction, for Question 1; Myers, The Art of Software Testing, for Questions 6 and 28.
PART I — General Principles
Question 4: Deriving OOD Classes from a Use Case Diagram (Part I)
A use case diagram names WHO interacts with the system (actors) and WHAT the system does for them (use cases), but says nothing about the system's internal structure; deriving a design-level class diagram from it is a systematic, if not purely mechanical, mapping exercise built on the Entity/Control/Boundary (ECB) responsibility categories used throughout this subject (Question 19).
Boundary classes, one per actor-facing interaction point. Each distinct way an actor interacts with the system (a screen, a form, an API endpoint) typically yields one Boundary class, since it is the interface surface the actor actually touches. A single actor may drive several Boundary classes if it uses several distinct screens/interfaces.
Control classes, typically one per use case. Each use case's step-by-step logic (the sequence of actions/decisions the use case performs) is naturally assigned to a Control class that orchestrates the interaction between the relevant Boundary and Entity classes for that use case, keeping that flow-of-control logic out of both the interface and the data classes.
Entity classes, one per persistent domain concept. Nouns appearing in the use case's description that must be stored beyond a single use-case execution (a Book, a Patron, an Order) become Entity classes, independent of which actor or use case happens to reference them — a single Entity is frequently shared across several use cases and Control classes.
Relationships between use cases (include/extend) suggest relationships between Control classes, e.g. an included sub-use-case's Control logic can be factored into a class the including use case's Control class calls, mirroring the use-case-level composition at the design level.
Crucially, this mapping is NOT a naming rule: an actor's name does not have to reappear as a class name, and a use case does not have to become exactly one class. The actor "Librarian" scopes WHO can trigger certain use cases; the resulting design might need only a shared StaffAccount Entity and a CirculationController Control class, with no class literally named Librarian at all. What transfers from the use-case model to the design model is the set of RESPONSIBILITIES the use cases imply (interface, orchestration, data), not the actors' or use cases' own names.