THE METHOD: [Part 5 of 6]
As I tried to build my message board I realized I was trying to do it all at once. I was trying to think about services and application state all at the same time.
In practice application state and services have almost nothing to do with each other. The application state is unique to the UI, script, or device for which it’s running. It’s unique to the run-history of the application. The purpose of the services are to support the business as a whole.
Applications and the services intersect when the application needs business functionality. The application enlist the service. Where the two do not intersect is inside of a service. Services should know nothing about an application or it’s state.
The goals and needs are very different. But they are not entirely separate.
Whether businesses realize it or not one of their primary functions is automation. Viewing applications through the lens of automation will make it easier to see the division between applications and services.
Businesses need at least two flavors of automation. Workflows and core business functions. Workflows may involve human interaction and they can be long running. Workflows require complex state management.
Business functions tend to be transactional. We want them short and to the point. Business functions try to be agnostic to application state. If there is state inherent in the business services try to handle it within the transaction. A goal is to avoid state from service call to service call.
Applications support automating of business workflows. Services support automating the core business functions. Both are about automation but from very different perspectives. Automation of the business workflows uses the automation of the core business functions. The core business functions are generally unconcerned with the business workflow.
When we design our applications we should map out the workflow. Once we have our workflows we should examine the process blocks. We are looking to see where they need the support of the business services. Keep in mind that the decision blocks within the workflow may also need the use of business services.
There is some discussion of this in the AMC but with very few examples. It’s discussed at the Architect’s Clinic. I recommend attending if you have the opportunity.
[part 6]