Key Concepts
Good design connects architecture to code. Design patterns give you proven micro-solutions. Reuse saves time and risk.
Design Patterns (GoF)
23 proven solutions to recurring OO design problems. Catalog by Gamma, Helm, Johnson, Vlissides (1994).
Object-Oriented Design
Design using classes, inheritance, polymorphism. Use UML to model before coding.
Implementation Reuse
Use existing libraries, frameworks, components, and open-source instead of building from scratch.
Configuration Management
Managing changes to software components — version control, build management, release management.
Concept Deep Dives
Click each concept to expand — real examples, diagrams, pros & cons.
Design Patterns (GoF)
When to Use
Whenever you recognize a recurring structural or behavioral problem in your code.
Real-World Example
Observer = React state/events. Singleton = DB connection pool. Factory = framework object creation. Strategy = payment methods.
✓ Advantages
- Proven solutions
- Common vocabulary for teams
- Reduce design effort
⚠ Watch Out
- Can be over-applied (pattern fever)
- Adds abstraction layers
- Wrong pattern = worse code
Factory, Abstract Factory, Builder, Prototype, Singleton
Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy
Chain, Command, Iterator, Mediator, Memento, Observer, State, Strategy, Template, Visitor
Object-Oriented Design
When to Use
Most modern application development in OO languages (Python, Java, C#, Ruby, TypeScript).
Real-World Example
Design: User→Account→Transaction class hierarchy before writing any Python/Java.
✓ Advantages
- Encapsulation reduces complexity
- Reusable abstractions
- Maps to real-world concepts
⚠ Watch Out
- Inheritance misuse (deep hierarchies)
- OO not always the best fit (functional can be better)
Implementation Reuse
When to Use
Always ask: does a library exist for this? Before building anything.
Real-World Example
Don't write your own crypto (use OpenSSL). Don't write your own auth (use Passport/Auth0). Don't reinvent logging (use Winston/Log4j).
✓ Advantages
- Faster delivery
- Battle-tested code
- Reduced maintenance burden
⚠ Watch Out
- Dependency hell
- Security vulnerabilities in deps (Log4Shell)
- License issues
Configuration Management
When to Use
Always — from day 1. Even solo projects need version control.
Real-World Example
Git + GitHub + CI/CD pipeline is configuration management. Every PR is a controlled change.
✓ Advantages
- Traceability of changes
- Rollback capability
- Team coordination
⚠ Watch Out
- Overhead for very small teams
- Merge conflicts
Quick Reference
- 1Object-oriented design: design system using interacting objects, each managing its own state.
- 2Design patterns: documented solutions to common design problems. GoF book has 23 patterns.
- 3Patterns classified as: Creational, Structural, Behavioral.
- 4Implementation reuse: open-source, libraries, frameworks, components.
- 5Configuration management: version control, build management, change management, release.
- 6Open-source development: use, modify, contribute. Understand licenses (MIT, GPL, Apache).
From the Book & Beyond
Case Study — The Wilderness Weather Station
Sommerville walks the whole OO design process using one running example: embedded software for a wilderness weather station that collects local weather data and beams it to a weather information system over a satellite link. You watch the design grow step by step — a context model (Figure 7.1), use cases like "Report weather" and "Powersave," subsystems (Fault manager, Data collection, Instruments) broadcasting over a shared communication link, object classes such as WeatherStation and WeatherData, a sequence diagram for data collection, and a state diagram of Shutdown → Running → Collecting. One tiny system, five design activities, fully worked.
2026 Perspective — Patterns Baked In, Open Source by Default
The Observer pattern Sommerville describes by hand? In 2026 you rarely write it yourself — it's baked into React state, RxJS streams, and Kotlin flows. Frameworks ship the Gang of Four patterns as defaults, so the real skill is recognizing which pattern your framework is handing you. And the chapter's open-source section became the whole industry: nearly every modern app sits on an open-source stack. That brought a new duty — supply-chain security. After incidents like log4shell and the 2024 xz backdoor attempt, teams now track dependencies with SBOMs and lockfiles. Reuse is free; trusting blindly isn't.
Quiz — Test Yourself
Think through your answer first, then reveal.