What Makes Good Software Architecture?
Software architecture lays the foundation for a software project. It's the backbone that determines the organization and structure of a software system. It's crucial and covers important aspects such as scalability, maintainability and flexibility. In this article, we'll explore what makes good software architecture and how it can improve your team's performance and the outcome of your project.
#What is not Architecture
However, many people tend to equate software architecture with specific design patterns such as MVP (Model-View-Presenter), MVVM (Model-View-ViewModel), or MVC (Model-View-Controller). While these patterns can be useful in certain situations, they should not be considered synonymous with software architecture. Good software architecture goes beyond design patterns.
#Traits of Good Software Architecture
Welcome requirement changes
Good architecture allows for changes in requirements to be easily accommodated. It can be easily modified or extended to meet new requirements without causing disruptions.
Improves estimation accuracy
A well-designed architecture makes it easier for teams to estimate the time and resources required to complete a project. It helps break down a project into smaller, manageable tasks.
Makes testing easier
Good architecture facilitates the testing process by making it easy to isolate and test specific parts of the system. It leads to more thorough testing and fewer errors.
If testing feels painful, it is often a sign that responsibilities are mixed together. I go deeper into that idea in Why Is Bad Code Bad?.
Maintains a fast and constant pace
Good architecture allows teams to maintain a fast and consistent pace of development. Teams can work on different parts of the system simultaneously without disrupting the overall system.
This is also where the Open-Closed Principle becomes practical: teams can add behavior without constantly editing already-working code.
#Writing Simple Code
This is good advice but, for those of us who have worked in the industry for some time (and I'm pretty new in historic standards), it's easier said than done.
Keeping code simple can be challenging and requires Discipline, and discipline is hard to come by when deadlines are tight and the pressure is on.
That's why we have to lean on different disciplines guided by principles and practices to help us write simple code, hence the relevance of the SOLID principles.
For a concrete example of those principles in action, read Practical Polymorphism in Swift, where protocols, decorators, and composition work together in a growing feature.
#Summing Up
Software architecture is the backbone of any software project. By following the SOLID principles, a software system can be designed in a way that is easy to maintain and adapt to changing requirements. This allows the team to work at a faster pace and with more independence. Keep in mind that good architecture is about the intent of the system and how it can best serve the needs of the users. With this in mind, you can create software that stands the test of time and meets the needs of all stakeholders.
#What you should remember
Good architecture is not the pattern name you choose. It is the set of boundaries that lets the team change the system confidently while keeping the intent of the product visible in the code.
Read next
Why Is Bad Code Bad? Readability, Collaboration, and Change
Learn why bad code hurts teams: unclear names, mixed responsibilities, duplication, weak tests, and hidden change costs.