Why Architecture Matters at Scale
By the end of this lesson, you'll be able to:
- Explain why a small project can get away without formal architecture, but a large one cannot
- Recognize the specific pain points that architecture addresses
- Preview the layered structure this module will build up over its remaining lessons
Prerequisites: Module 42: "Project: Banking System"
What Module 42 got away with
Module 42's banking system put trigger logic directly in TransactionTrigger and TransactionValidation, and query logic directly inline in BankAccountService. For a nine-lesson project, this was the right amount of structure — anything more would have been premature. But imagine that same codebase with forty objects, two hundred fields, and a dozen developers touching it simultaneously: the same "logic lives wherever it's needed" approach breaks down fast.
The specific pain points at scale
- Duplicate logic — the same query written slightly differently in five different triggers, each with its own subtle bug.
- Hard-to-test code — business logic tangled together with SOQL and DML, forcing every unit test to hit the database even for logic that has nothing to do with data access.
- Merge conflicts — many developers editing the same giant trigger file simultaneously.
- Fear of change — nobody fully understands how a change in one place will ripple elsewhere, so people are afraid to refactor even obviously bad code.
This module's roadmap
The remaining lessons build up one cohesive layered architecture, piece by piece: separation of concerns (Lesson 2) as the guiding principle, then concrete layers — service (Lesson 3), selector (Lesson 4), domain/trigger handler (Lesson 5) — followed by supporting patterns — dependency injection (Lesson 6), factory (Lesson 7), strategy (Lesson 8) — and closing with DTOs and a caution against overengineering (Lesson 9), so the module ends by reinforcing that architecture is a tool, not a goal in itself.
Exercise
As a comment, name one specific pain point from Module 42's banking system that would get worse if the codebase grew to forty objects and a dozen developers, without any additional architecture.
Show hint
Think about TransactionTrigger specifically.
Why Architecture Matters at Scale Quiz
My Notes
Log in to keep private notes on this lesson.
Questions about this lesson
No questions yet — be the first to ask.
Log in to ask a question about this lesson.
Summary
Architecture is the set of structural decisions that keep a codebase understandable and changeable as it grows — decisions that barely matter for a six-lesson project but become essential once a system has dozens of triggers, services, and integrations.