Conclusion – Architectural Principles

The core idea is to depend on abstractions. Interfaces are pure contracts, which makes them more flexible than abstract classes. Abstract classes are still helpful, and we explore ways to leverage them in the book.Depending on implementations (classes) creates tight coupling between classes, which leads to a system that can be harder to maintain. The cohesion between your dependencies is essential in whether the coupling will help or hurt you in the long run. Don’t discard concrete types everywhere mindlessly.

Summary

In this chapter, we covered many architectural principles. We began by exploring DRY, KISS, and separation of concerns principles before learning about the SOLID principles and their importance in modern software engineering. By following those principles, you should be able to build better, more maintainable software.As we also covered, principles are only principles, not laws. You must always be careful not to abuse them so they remain helpful instead of harmful. The context is always essential; internal tools and critical business applications require different levels of tinkering. The key takeaways from this chapter are:

With all those principles in our toolbox, we are ready to jump into design patterns and get our design level one step further, with the next chapter covering the MVC pattern in the context of ASP.NET Core REST APIs.Afterward, in the following few chapters, we explore how to implement some of the most frequently used Gang of Four (GoF) patterns and then how to apply them at another level using dependency injection.

You may also like