2IRR00 · resource
Cheat sheets
Design Pattern Picker
Match the problem to the pattern — the most exam-relevant decisions.
When you need to…
| Concept | Reference |
|---|---|
| Ensure exactly one instance | Singleton |
| Create objects without naming concrete classes | Factory / Abstract Factory |
| Add behaviour to an object at runtime | Decorator |
| Hide a complex subsystem behind one interface | Facade |
| Encapsulate a request / support undo-redo | Command |
| Notify many objects when one changes | Observer |
| Swap an algorithm at runtime (same goal) | Strategy |
| Traverse a structure without exposing it | Iterator |
| Fix an algorithm skeleton, vary steps | Template Method |
| Change behaviour with internal state | State |
| Separate data, display and glue (GUI) | MVC |
Look-alikes (intent decides!)
| Concept | Reference |
|---|---|
| Strategy vs State | Same structure. Strategy = interchangeable, same goal, client-chosen. State = behaviour changes completely, states linked, object transitions. |
| Strategy vs Template | Composition vs inheritance; swap whole vs modify parts; object/dynamic vs class/static. |
| Facade vs Blob | Facade = minimal interface, delegates. Blob = does everything (anti-pattern). |
UML Notation Reference
Symbols and rules for the three diagram types — with slides directly from the lectures.
Class diagram relationships
| Concept | Reference |
|---|---|
| Generalisation (inheritance) | Hollow triangle → superclass. 'is a'. |
| Association | Plain line, optional name/direction + multiplicities. |
| Aggregation | Hollow ◇ diamond at the whole. Parts exist without whole (independent lifetime, shareable). |
| Composition | Filled ◆ diamond at the whole. Part only exists in one whole at a time (deleted together). |
| Abstract class | Italic name or {abstract}; cannot instantiate. |
| Visibility | + public, # protected, ~ package, - private. |
| Multiplicity | 0..1, 1, n, 1..*, *. |
Use-case diagram
| Concept | Reference |
|---|---|
| Use case | Ellipse. |
| Actor | Stick figure or «actor» rectangle, solid line to use case. |
| «include» | Dashed arrow → included use case (always executed). |
| «extend» | Dashed arrow → base use case (optional, at extension point). |
| System | Rectangle boundary. |
Activity diagram
| Concept | Reference |
|---|---|
| Action | Rounded rectangle. |
| Initial / final | Filled dot / bullseye. |
| Decision/merge | Diamond. Each decision needs a merge (alternative flows). |
| Fork/sync | Bar. Each parallelization needs a synchronization (parallel flows). |
| Don't mix | Decision/merge ≠ fork/sync. |
Invalid learning block
media.gallery · uml-notation-slides
Principles & Definitions Card
One-liners you can recall under exam pressure.
SOLID
| Concept | Reference |
|---|---|
| S — Single responsibility | One reason to change. |
| O — Open/closed | Open for extension, closed for modification. |
| L — Liskov substitution | Subclass works wherever superclass is used. |
| I — Interface segregation | No dependency on unused methods. |
| D — Dependency inversion | Depend on abstractions, not concretes. |
| ⚠ Not SOLID | Separation of concerns (general principle, distractor). |
Other principles
| Concept | Reference |
|---|---|
| Coupling | Interaction between units — minimise. |
| Cohesion | Single purpose of a unit — maximise. |
| DRY | Don't Repeat Yourself. |
| KISS | Keep It Simple. |
| Design by contract | @pre (client), @post (method), invariant. |
Requirement types
| Concept | Reference |
|---|---|
| Functional | A behaviour the system offers. |
| Quality | A measurable -ility/limit (with conditions). |
| Constraint | A fixed technology/standard. |
Git Command Card
The commands you must be able to explain.
Core commands
| Concept | Reference |
|---|---|
| git clone <url> | Create a local copy of the remote. |
| git add <files | .> | Stage specific/all files (to the index). |
| git commit -m "msg" | Snapshot the staging area into the LOCAL repo. |
| git push | Send committed changes to the remote. |
| git pull | Fetch + merge changes from the remote. |
| git status / diff / log | Inspect state / differences / history. |
Pipeline & danger
| Concept | Reference |
|---|---|
| Pipeline | working dir → add → staging → commit → local repo → push → remote. |
| git reset --hard | ⚠ Loses uncommitted changes. |
| git push --force | ⚠ Overwrites others' commits. |
Common Mistakes (do / don't)
From the official 'Common Issues' guide — applies to exam reasoning too.
General
| Concept | Reference |
|---|---|
| Don't | Use vague terms (few/many); mix problem with solution. |
| Do | Use concrete numbers; document the 'why'. |
Use cases & diagrams
| Concept | Reference |
|---|---|
| Don't | Model processes/decomposition in use-case diagrams; reverse include/extend; mix abstraction levels. |
| Do | Explain every diagram; associate actors to all relevant use cases. |
Requirements
| Concept | Reference |
|---|---|
| Don't | Combine requirements (and/or); underspecify quality conditions. |
| Do | Tabulate ID/description/priority; separate functional/quality/constraint; apply SMART. |
Activity diagrams & testing
| Concept | Reference |
|---|---|
| Don't | Skip merges/syncs; mix decision with fork; pick many cases from one equivalence class. |
| Do | Pair each decision with a merge, each fork with a sync; connect tests to requirements/activities. |