Full Description
Many developers excel at building solutions in Apex but lack formal training in the core principles of professional software engineering. This book changes that and provides a no-nonsense guide for experienced Salesforce developers ready to master the art of software design.
Pragmatic, approachable, and to the point, this book focuses on essential practices like modularity, coupling, cohesion, and testing—not just to write better code, but to improve how teams deliver software. By emphasizing object-oriented programming, dependency injection, and boundaries, it equips you to design systems that are easier to maintain, test, and scale. With fast, reliable tests as a cornerstone, you'll learn how great design enables true continuous integration and high-performance software delivery.
Through actionable examples and clear explanations, you'll learn how to design better systems, reduce complexity, and create codebases that stand the test of time. If you're serious about your craft, Clean Apex Code will give you the tools and mindset to think like a professional software engineer and deliver software at a higher level.
What You Will Learn
Use better names in all software constructs to improve readability and maintainability
Apply core software design principles to Apex development
Embrace modularity, abstraction, and boundaries to simplify complex systems
Leverage dependency injection, and mocking to write fast, modular tests
Practice real continuous integration with reliable, high-speed testing
Who This Book Is For
Experienced Salesforce developers and professional software engineers
Contents
Chapter 1: Refactoring Apex code: First steps.- Chapter 2: Naming: Simple Techniques for Better Software Design.- Chapter 3: Doing One Thing: Abstraction, Boolean Parameters, and Design Patterns.- Chapter 4: How long should methods be: length, depth and subtasks.- Chapter 5: Comments don't lie, developers do.- Chapter 6: Null, validations and guard clauses.- Chapter 7: Cascading failures in trigger boundaries.- Chapter 8: Object-Oriented Programming in Apex.- Chapter 9: Software Design Principles.- Chapter 10: Modularity, Coupling and Cohesion.- Chapter 11: Dependency Injection and Boundaries.- Chapter 12: Unit Tests, Stubs and Mocking the Salesforce Database.- Chapter 13: The Apex Well-Architected Framework.