Question 19 of 25: Separating Boundary from Entity/Control Classes
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, agile methods, design principles; 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 — structural/behavioural pattern catalogue (Proxy, Bridge, Strategy, Observer, Template Method, Composite, etc.); Sebesta, Concepts of Programming Languages (12th ed.) — polymorphism, dynamic binding, inheritance and language-level object semantics (also underpins the Java/C++ discussion in Part V). Bertrand Meyer's Object-Oriented Software Construction is cited by name where the paper's own vocabulary (design by contract, open–closed principle) originates there; Barbara Liskov's 1987 substitutability paper is likewise cited by name for Question 11.
PART I — General Principles
Question 19: Separating Boundary from Entity/Control Classes (Part IV)
Boundary classes model the interface between the system and its actors (a screen, an API endpoint, a device driver) and are, by their nature, VOLATILE — they change whenever the presentation technology changes (a new UI toolkit, a new device, a redesigned screen layout, localizing for a new market) even when the underlying business logic and data are completely unchanged.
Keeping Boundary separate from Entity (persistent domain data) and Control (use-case orchestration logic) confines presentation-layer churn to the Boundary classes alone, and it never forces changes to Entity/Control classes; conversely, business-rule changes never force a UI rewrite.
Impact of NOT separating (business logic embedded directly inside GUI event handlers):
Implementation: the same business logic cannot be reused behind a different interface (e.g., exposing the same rules through a REST API alongside a desktop GUI) since the logic is welded to one specific UI technology's event model.
Testing: business logic embedded in UI event handlers can only be exercised by driving the actual UI — slow, brittle, and often requiring a real or simulated display — instead of fast, headless unit tests against a pure Entity/Control class with no UI dependency at all; this is the single largest practical cost of not separating.
Maintenance: a UI framework upgrade or platform port (e.g., desktop to web) forces re-verifying and often re-writing business logic that merely happened to live inside now-obsolete UI classes, multiplying the cost and risk of what should have been a purely cosmetic change.
This is exactly the requirements-analysis-level rationale underlying both Question 9 (actor vs. class independence) and Question 18 (MVC's View/Model split) — the Boundary/Control/Entity pattern is the general responsibility-assignment principle both of those questions are specific instances of.