With the growing complexity of applications, and the urging need to write applications that will be exposed to the outside world sooner or later, I realized that defining only one service layer in an application is not enough. In the past, I tried to introduce Helper classes to do some of the heavy work for a service layer. It turned out though that the Helper itself could have been defined as a Service and reused elsewhere.
Now I started designing according to four categories of services:
- Human to Application Services
- Application to Application Services
- Aggregated core Services
- Core Services
Core ServicesThese are mainly data access services. These are the only services allowed to communicate with the data access layer.
Aggregated core servicesThese services combine and orchestrate other services to produce aggregated services.
Application to Application ServicesThese services are exposed as endpoints of the application. They are conversational, configured rather than coded and are data or event driver.
Human to Application ServicesThese services interact directly with humans, are message oriented and aligned closely with the real business processes.