There are two types of concerns that you need to have when writing clean code—core concerns and cross-cutting concerns. Core concerns are the reasons for the software and why it is being developed. Cross-cutting concerns are the concerns that are not part of the business requirements and that form the core concerns, but must be addressed in all areas of the code, as illustrated in the following diagram:
It is the cross-cutting concerns that we will be covering in this chapter by building a reusable class library that you can modify or extend to your liking. Cross-cutting concerns include configuration management, logging, auditing, security, validation, exception-handling, instrumentation, transactions, resource pooling, caching, and threading and concurrency. We will use the decorator pattern and the PostSharp Aspect Framework to help us build our reusable...