SD&A · Sheet Set 04.03
Chapter 04 · Lecture 03 · Architecture Patterns

Boxes talk to boxes.
Learn the wiring.

A memorize-friendly rebuild of the MVC and Layered pattern lecture — with the mnemonics, flows, and interfaces you actually need for the exam, drawn as the box‑and‑line schematics they really are.

Interactive Systems Hierarchical Systems MVC Layered Pattern Real‑Estate Case Study
FIG. 01 — MVC SKELETONNTS
View 1
Controller 1
View 2
Controller 2
View n
Controller n
Model — core data & functionality
01 · The Big Map

Two families of systems, one pattern each (plus a bonus)

Everything in this chapter hangs off one split. Ask: does the user interact with it? If yes → Interactive. If it's built from clean levels of abstraction → Hierarchical.

ISInteractive Systems

Systems built around user interfaces. The two quality attributes that matter most: Usability and Modifiability.

Main pattern: Model‑View‑Controller (MVC)

Think: any app with a screen the user touches, speaks to, or gestures at.

HSHierarchical Systems

Systems decomposed into levels, top (abstract) to bottom (concrete). Each level only needs to know the level next to it.

Two patterns: Main Program & Subroutine · Layered (our focus)

Think: an OS — hardware drivers at the bottom, UI logic at the top.
MEM
Interact with a View → Hierarchy of Layers

IVHL — Interactive→MVC, Hierarchical→Layered. If you remember this pairing, you can't mix up which pattern answers which question type on the exam.

02 · Model‑View‑Controller

MVC — three roles, one job each

MVC decomposes an interactive system into Model, View, and Controller so the same data can be shown and driven in many different ways without touching the core logic.

Component What it does Memory hook
Model The system's core — data + major processing capabilities. When data changes, it updates its Views. "The Model has the facts."
View Output representation shown to the user (graphical, console, voice reply...). Every View is paired with a Controller. "The View is the face."
Controller Receives user input and translates it into service requests sent to the Model. "The Controller is the hands."
MEM
"Model has Facts, View has a Face, Controller has Hands."

Facts don't move until the Hands push them, and the Face just shows whatever the Facts currently say.

03 · The Loop That Never Stops

The flow: User → Controller → Model → View → User

Every MVC exam question is secretly asking you to trace this loop. It's alliterative on purpose — use that.

1 User acts (click / gesture / voice)
2 Controller translates input → request
3 Model updates data, notifies Views
4 View refreshes to show new state
User sees result
MEM
"Users Click, Controllers Convert, Models Mutate, Views Visualize."

U‑C‑M‑V, and each role's job starts with the same letter as the role — the sentence is the definition.

Worked example — real estate system

Same Model, two very different Views/Controllers — this is why MVC exists.

🖐Large Screen

User: waves hands at a wall‑sized display.
Controller: gesture recognition → sendCommand(FIND, SFH, 33803)
View: map with pins refreshes to show matches.

🎙Small Screen

User: "Find single family home in Lakeland, FL."
Controller: speech recognition → same sendCommand(...) shape
View: laptop screen updates the same underlying results.

Two‑way dependency gotcha: a View requires the Model (to fetch data) — but the Model also requires the View (to push updates). Both "provide" and "require" exist at once because of the Observer pattern wiring underneath MVC (View registers as an IObserver of the Model).
04 · Why Bother

MVC's payoff: M‑U‑R

MModifiability

Easy to swap, enhance, or add new user interfaces without rewriting the Model.

UUsability

Different UIs can be configured per audience (gesture wall vs. voice phone) from the same core.

RReusability

Because concerns are separated, Model, View, and Controller can each be reused in other systems.

Common variations: fusing View+Controller (Microsoft's 1990s Document‑View) or the more elaborate Process‑Abstraction‑Controller pattern.

05 · Hierarchical Systems

Layered Pattern — stack it, don't tangle it

Each layer only talks to the layer directly above/below through a well‑defined interface. Higher layers consume what lower layers provide — nothing skips a level.

FIG. 02 — REMOTE MONITOR SYSTEM (4 LAYERS)TOP → BOTTOM
SatcomLayer
Satellite communication functions
IJSatcomprovides comms to layers below
provides ↓ / requires ↑
SecurityLayer
Encryption & security
IJSecureprovides security · requires app
provides ↓ / requires ↑
ApplicationLayer
Main app logic, business rules
IApplicationprovides app · requires hardware
provides ↓ / requires ↑
HardwareLayer
Physical devices & sensors
IHardwareprovides HW access · requires monitoring
MEM
"Security Stacks Above Hardware" → Satcom / Security / Application / Hardware, top to bottom.

Or just remember: the layer nearest the user is the most abstract; the layer nearest the metal is the most concrete.

06 · Why Layers Pay Off

Layered's payoff: M‑P‑S‑R

MModifiability

Dependencies stay local — swap a layer's implementation without touching the others.

PPortability

Encapsulate the platform API in one system layer; port that layer and everything above moves free.

SSecurity

Controlled hierarchy makes it easy to slot in an encrypt/decrypt layer at the right boundary.

RReusability

Each layer's services are compartmentalized, so they're easy to lift into another system.

MEM
"My Program Stays Reusable."

MPSR — the exact same 4 letters, every time a question asks "why use layers?"

07 · Side by Side

MVC vs. Layered — don't confuse them

MVC

System type: Interactive

Shape: One Model, many View/Controller pairs, all peers.

Direction of data: Circular — User↔Controller↔Model↔View↔User.

Qualities: Modifiability, Usability, Reusability

VS

Layered

System type: Hierarchical

Shape: Strict stack — level N only touches level N±1.

Direction of data: One‑way per hop — provides down, requires up.

Qualities: Modifiability, Portability, Security, Reusability

08 · Memory Toolkit

All the mnemonics, in one place

1Pattern choice

IVHL — Interact with a View → Hierarchy of Layers.

2MVC roles

Model = Facts, View = Face, Controller = Hands.

3MVC flow

Users Click, Controllers Convert, Models Mutate, Views Visualize (U‑C‑M‑V).

4MVC payoff

M‑U‑R — Modifiability, Usability, Reusability.

5Layer order

Satcom → Security → Application → Hardware (top to bottom).

6Layered payoff

M‑P‑S‑R — "My Program Stays Reusable" (Modifiability, Portability, Security, Reusability).

09 · Bonus — From Your Own Midterm

Quick refreshers that keep tripping people up

Pulled straight from the graded midterm pages you shared — the exact spots partial credit was lost. These aren't from this chapter, but they sit right next to it on the exam.

Quality Attribute Scenario — 6 parts

Every scenario has exactly these six pieces. Say all six, every time, even if the question only shows a diagram.

1
Source
2
Stimulus
3
Artifact
4
Environment
5
Response
6
Response Measure
Graded note: "describe the scenario" answers lost points for skipping the Environment and Response Measure — narrate the picture left‑to‑right, naming each of the six.

Diagram type ↔ View, don't guess

A "consoles + LAN server" box diagram is a component diagram, and that represents the Development view — not Physical/Deployment (that needs actual hardware nodes & installation).

Logical → Class/Object/State/Sequence Process → Activity Development → Component/Package Physical → Deployment Scenario → Use Case

"Valid requirement?" test

A functional/quality requirement is only valid if it's measurable and specific. "The software shall be secure and fast" fails — no bandwidth number, no auth mechanism named, nothing to check it against.

Rule of thumb: if two stakeholders could disagree on whether it was met, it isn't valid yet.

Modularization — 2 strategies

Modularization = continuously decomposing a system into fine‑grained components.

Abstraction — show only what's important, hide the "how."
Encapsulation — hide data, expose only what's needed.

They work together: Abstraction decides which parts are needed; Encapsulation decides what's shown vs. hidden about them.

Pipes & Filters (Ch.4 sibling pattern)

4 components: Source (data in) → Filter (transform) → Pipe (transmit) → Sink (consume).

Parallel/graph layout (B) beats strict sequential (A) on performance — filters run concurrently. Security can be injected as a filter at any stage (firewall, auth, detection).

Availability building block

Source → Stimulus (crash, omission, timing, incorrect response) → Artifact → Response (prevent / log / notify / disable source / go temporarily unavailable) → Measure (time available, detection time, repair time).

Graded note: "disable source of failure" and "repair source of failure" are two different responses — don't merge them into one bullet.

Design‑pattern cheat table (quick recall grid)

Family Patterns One‑line hook
Creational Abstract Factory · Factory Method · Builder · Singleton · Prototype How an object gets born.
Structural Adapter · Facade · Composite · Bridge · Decorator · Flyweight · Proxy How objects get wired together.
Behavioral Iterator · Observer · Strategy · State · Command · Template Method · Visitor · Mediator · Memento · Interpreter · Chain of Responsibility How objects talk and decide.
MEM
"Create it, Structure it, then watch it Behave." (C‑S‑B, in build order)