Chapter 7. Writing Your Own Middleware

Up to now you have concentrated your efforts on learning the patterns and principles to keep your code modular and loosely coupled. These are valuable techniques that will allow you to build applications that will be maintainable and flexible to meet you business needs. However, these principles and practices are merely a side show, a collection of tools in your coding toolbox, if you will, that enable you to carry out your work. The main purpose of your application and the sole purpose of our existence as developers is to solve business problems. It's odd then that a large proportion of development time is spent writing plumbing code instead of business logic; this chapter is all about refocusing your efforts and readdressing the balance by providing you with some practical patterns that will enable you to map your business goals effectively. Before you read about the many patterns at your disposable to organize your business logic it's important that we define what exactly the role of the business logic layer is and how it fits in with the rest of your applications layers.

Business Logic Layer

The business logic layer is an abstract layer that contains all the rules, workflow and validation that define and deal with the business complexities that your software has been designed to meet. Typically, the business logic layer will fit between your user interface, service, or presentation layer and your data access layer, as shown in Figure 7-1 ...

Get Professional Enterprise .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.