Key Concepts
Architecture drives non-functional quality. Get it wrong early and you'll rebuild it later — at 10x the cost.
Model-View-Controller
Separates data (Model), presentation (View), and user interaction (Controller).
Layered Architecture
System organized into layers — each layer only uses the layer directly below it.
Repository Pattern
All components share a central data store. No direct component-to-component communication.
Client–Server
Services delivered by servers. Clients request services via network.
Pipe and Filter
Data flows through sequential transformation stages. Each filter does one job.
Concept Deep Dives
Click each concept to expand — real examples, diagrams, pros & cons.
Model-View-Controller
When to Use
Web apps, any UI-heavy system, when data and presentation may change independently.
Real-World Example
Django, Rails, Laravel, Spring MVC — every major web framework is built on MVC.
✓ Advantages
- Data independent of UI
- Multiple views of same data
- Testable components
⚠ Watch Out
- Overkill for simple apps
- Can lead to bloated controllers
Layered Architecture
When to Use
Enterprise apps, multi-team development, multilevel security requirements.
Real-World Example
Most web applications: UI → Business Logic → Data Access → Database.
✓ Advantages
- Swap layers without touching others
- Portable
- Incremental development
⚠ Watch Out
- Layer-skipping in practice
- Performance overhead
Repository Pattern
When to Use
IDEs, data-driven tools, large volumes of shared data.
Real-World Example
Git repositories, IDEs (shared symbol table), database management systems.
✓ Advantages
- Independent components
- One change propagates everywhere
- Consistent data
⚠ Watch Out
- Single point of failure
- Hard to distribute
Client–Server
When to Use
Shared database from many locations, web apps, variable load.
Real-World Example
Every web app, REST API, email system, DNS.
✓ Advantages
- Distributed
- Add servers without touching clients
⚠ Watch Out
- Server = single point of failure
- Network dependency
Pipe and Filter
When to Use
Batch processing, ETL, compilers, CI/CD pipelines.
Real-World Example
Unix pipes, compilers, data ETL, billing systems.
✓ Advantages
- Easy to understand
- Add a stage = add a filter
- Can be parallel
⚠ Watch Out
- All filters must agree on data format
- Bad for interactive UIs
Quick Reference
- 1Architecture: description of how a software system is organized. Affects performance, security, availability.
- 2Architecture design decisions: type of application, distribution, patterns, documentation.
- 34+1 Views: logical, process, development, physical, + scenarios (Kruchten).
- 4Architectural patterns: MVC, Layered, Repository, Client-Server, Pipe and Filter.
- 5Transaction processing systems: database-centered, atomic operations, ATMs/e-commerce.
- 6Language processing systems: compilers — lex → parse → semantic → codegen.
Quiz — Test Yourself
Think through your answer first, then reveal.