O'Reilly logo

Professional ASP.NET Design Patterns by Scott Millett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. The Service Layer

WHAT'S IN THIS CHAPTER?

  • The role of services and the service layer in an enterprise ASP.NET application

  • Service oriented architecture and why it's needed

  • The use of the Facade pattern

  • Messaging patterns such as document message, request-response, reservation, and idempotent

  • An exercise that utilizes WCF for SOA in addition to well-known messaging patterns

Chapter 4 dealt with the organization of your business middleware, but how do you expose the business logic to your applications in an easy-to-use and consistent manner that maps to your business needs? The answer lies in the service layer.

Sitting between your presentation and business layer, the service layer provides an interface that defines the application's boundaries and the operations available to the client. Behind the façade that the service layer portrays to the client is the encapsulation of business logic, validation, and workflow and the coordination of persistence and retrieval of business entities.

DESCRIBING THE SERVICE LAYER

The role of the service layer is similar to that of the Transaction Script pattern that was introduced in Chapter 4 in that it typically maps to business use cases. Unlike the Transaction pattern, however, the service layer simply coordinates the business use case transaction and delegates work to the business objects for all the lower-level implementation details. The service layer encapsulates the business model and acts as an interface into the application for all parties, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required