Many Salesforce orgs run 10+ years. Architecture should age gracefully.
Principles:
1. Use platform features over custom code.
- Salesforce evolves features; custom code requires maintenance.
- Native features age well; custom often becomes legacy.
2. Standard patterns.
- Use community-validated patterns (FFLib, Apex Recipes).
- Aligned with Salesforce direction.
3. Loose coupling.
- Components decoupled; replaceable.
- Tight coupling produces brittle systems.
4. Documentation.
- Survives team changes.
- Reduces re-discovery cost.
5. Test coverage.
- Catches regressions.
- Enables refactoring confidence.
6. Modular architecture.
- Smaller pieces; easier to evolve.
- Replace one component at a time.
7. Configurable behaviour.
- Custom Metadata for config.
- Adjust without code changes.
8. Anticipate platform direction.
- Build aligned with Salesforce roadmap.
- Don't fight the platform.
Anti-patterns that age poorly:
- Heavy custom code on legacy patterns (Visualforce, Aura) — depreciation.
- Hardcoded assumptions — break on changes.
- Tightly coupled — small changes cascade.
- Untested code — regressions invisible.
- Documentation absent — knowledge walks out the door.
Senior architect insight: the code you write today is the legacy code of 5 years from now. Write with that in mind.
The senior framing: architecture should make future architects' jobs easier, not harder. Pay it forward.
