NivaarExam PrepOfficial exam papers ↗

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)

Notes on this paper

17-Comp-B11 Advanced Software Design — National Exams, December 2018. 3 hours, closed book exam with up to 2 aid sheets allowed (written on both sides), no calculator permitted. The paper is organized into five parts, and candidates were instructed to answer any five (5) questions in Part I, any three (3) in Part II, any four (4) in Part III, any two (2) in Part IV, and any five (5) in Part V — only the first questions answered, in each part, as they appear in the answer book are marked. All questions carry equal weight, so the 19 questions actually marked (5+3+4+2+5 of 28) each count for 100/19 ≈ 5.26% of the paper. All 28 questions are answered below for completeness.

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 (answer any 5 of 7)

Question 4: Deriving OOD Classes from a Use Case Diagram (Part I)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

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).

  1. 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.
  2. 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.
  3. 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.
  4. 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.