Presented at "Dubai Software Crafters Community" meetup on Sep 12, 2023.
"No plan survives contact with the enemy." goes an adage. This is sadly true for most software engineering principles too. Developers must constantly work against entropy to restore order in their codebases.
SOLID principles have guided many developers to validate their solutions and have helped many build maintainable software systems. However, it can be daunting to practice in the real world without constant feedback, upskilling, and support from peers and tooling.
In this talk, we aim to take a closer look at the first of the five object-oriented design principles from SOLID—Single-responsibility principle. We'll look at large classes and how they violate SRP. We'll also discuss insights and heuristics to identify each of these responsibilities.
What's good comes out of mere insights and heuristics? We'll also put these to good use in practice. At the end of the session, we'll pick one of the most popular messaging apps on Android and do the following,
- Visualize it with tooling
- Identify multiple responsibilities
- Discuss code smells
- Extract at least one responsibility into a separate class without tests