SCS2303 · Software Architecture

Understand software design, deeply.

An interactive companion to the whole module — object-oriented design, SOLID, all 23 GoF design patterns, clean code, architectural patterns, and microservices. Every concept comes with the reasoning behind it: the problem it solves, what breaks without it, C# code (▶ runnable examples and ✂ illustrative fragments, each labelled), diagrams, and hands-on simulations you can play with.

How to use this site

Follow the chapters in order — each one builds on the previous. In every chapter: read the problem first (why the naive approach hurts), play with the ⚡ interactive demos, then study the C# code. Finish each page with its mini-quiz, and when you've covered the pattern chapters, use Confusable Patterns to make the distinctions stick and Test Yourself to check the whole picture.

The learning path

The module is really one long story in four acts:

Act 1 — Foundations. What objects, classes, and their relationships actually mean, and what "good design" even is. This gives you the vocabulary (coupling, cohesion, SOLID) used to justify every pattern later.
Act 2 — Design patterns. 23 battle-tested solutions to recurring design problems, in three families: creational (how objects get made), structural (how objects are composed), and behavioral (how objects communicate).
Act 3 — Clean code. Design happens at the large scale and in every line. Naming, functions, comments, formatting, and test-driven development.
Act 4 — Architecture. Zoom out from classes to whole systems: layered architectures, MVC, pub/sub, SOA — and the modern heavyweight, microservices, right down to the patterns that keep a distributed system honest (gateway, circuit breaker, saga, CQRS, sidecar).

Chapters

CHAPTER 1

OO Fundamentals & UML

Abstraction, encapsulation, inheritance, polymorphism · association vs aggregation vs composition · delegation · UML diagrams.

CHAPTER 2

Good Design & SOLID

Code reuse & extensibility · encapsulate what varies · program to an interface · composition over inheritance · the five SOLID principles · what a design pattern is.

CHAPTER 3

Creational Patterns 5 patterns

Factory Method · Abstract Factory · Builder · Prototype · Singleton — flexible ways to create objects without hard-wiring classes together.

CHAPTER 4

Structural Patterns 7 patterns

Adapter · Bridge · Composite · Decorator · Facade · Flyweight · Proxy — composing objects into larger, flexible structures.

CHAPTER 5

Behavioral Patterns 11 patterns

Chain of Responsibility · Command · Iterator · Mediator · Memento · Observer · State · Strategy · Template Method · Visitor · Interpreter.

CHAPTER 6

Pattern Fusion Case Study

Design a full document editor by combining many patterns — how patterns work together in a real system.

CHAPTER 7

Clean Code

Meaningful names · small functions · comments · formatting · unit testing and the three laws of TDD.

CHAPTER 8

Architectural Patterns system level

3-tier · MVC · peer-to-peer · SOA · blackboard · publish/subscribe · broker · service locator · clusters.

CHAPTER 9

Microservices I

Monoliths vs microservices · the scale cube · API gateway · inter-process communication · service discovery.

CHAPTER 10

Microservices II

Polyglot persistence · event-driven architecture · deployment patterns · refactoring a monolith.

CHAPTER 11

Microservices III — MSA Patterns

API gateway · circuit breaker · saga (choreography vs orchestration) · CQRS · sidecar · idempotency keys · dead letter queues · Factory/Adapter/Strategy inside a service.

CHAPTER 12

Confusable Patterns

Strategy vs State, Adapter vs Bridge vs Decorator vs Proxy, Factory Method vs Abstract Factory, Observer vs Pub/Sub vs Mediator… side by side, disambiguated.

CHAPTER 13

Test Yourself

Scenario-based quizzes across the whole module: "which pattern (or principle) fits this situation?"

STUDIO 14

Foundations Studio 🔨

Decide → build → articulate: OO relationships, UML, and SOLID on a full scenario, with real C# projects and tests to turn green — plus the AutoOS capstone.

STUDIO 15

Patterns Studio 🔨

Assignment-style pattern labs: computer configurator (Builder→Decorator/Composite), legacy-system integration (Adapter+Proxy), catalogs (Iterator), a library fusion lab, and the RetailCore capstone.

STUDIO 16

Critique & Architecture Studio 🔨

Mark up smelly code line-by-line, run a TDD kata, critique inheritance abuse, and drill the SOA-vs-MSA / MVC-vs-3-tier articulation questions — plus the StreamArchitect capstone.

STUDIO 17

Mock Exams 📝

The real past paper and both in-class assignments, with commit-before-reveal answers, full model solutions, and marking rubrics — sit them timed, then self-mark.

About the examples

The lecture materials use Python; this site uses C# throughout. The concepts are identical — design principles and patterns are language-independent — but C# makes some of them clearer, because it has real interfaces (interface), access modifiers (private/public), abstract classes with enforced contracts, and properties. Where Python and C# genuinely differ in how a pattern is realised, the chapters point it out.

Language baseline: C# 12 / .NET 8. Code blocks carry an honesty badge: ▶ runnable compiles and runs as a console app pasted as-is; ✔ compiles means every type in the block is complete and compiles (verified with the .NET compiler) but you add your own Main/usage line to see output; ✂ fragment shows the relevant classes or lines and assumes surrounding context. Where the lecture slides simplify something that works differently in practice, you'll find a "🎓 Lecture view vs reality" note giving both — learn the slide version for the exam and the real-world nuance.