Understanding Layering
In this chapter, we explore the inherent concepts behind layering. Layering is a popular way of organizing computer systems by encapsulating major concerns into layers. Those concerns are related to a computer vocation such as data access instead of a business concern such as inventory. It is essential to understand the concepts behind layering as other concepts were born from layers, and they are very common.
We start this chapter by exploring the initial ideas behind layering. Then, we explore alternatives that can help us solve different problems. We use both anemic and rich models and expose both pros and cons in action. Finally, we quickly explore Clean Architecture, which is what I call an evolution of layering.
This chapter lays out the evolution of layering, starting with basic, restrictive, even flawed techniques, then gradually moves toward more modern patterns. This journey should help you understand the concepts and practices behind layering...