Building Reusable, Service-Oriented Components in Cloud Computing
Building reusable service-oriented components in cloud computing can be very challenging. You need to identify which components are best suited for reuse. To accomplish this goal, you need to keep business logic separate from plumbing — technical infrastructure.
To build a software application, you must tell the computer how to do what you want on two levels:
In human terms: the business logic
In computer terms: the plumbing
Business applications comprise lines of program code that tell computers what actions to take. Some of these instructions are written as business logic — Add an item line to the order, for example. Some are simply plumbing at the infrastructure level — computer-level directives, such as Check that the printer is available. Both are necessary.
If you don’t describe the application’s activity in simple business logic (purchase orders, products, customers, accounts, and so on), you quickly lose sight of what you’re trying to achieve. If you don’t describe in computer terms exactly how the computer should carry out its task, the software simply won’t work.
Business logic needs to be as free of plumbing dependencies as possible if you intend to follow a service-oriented approach. You need to keep them separate so you maintain flexibility when things change.
For example, if you want to change the order in which particular business functions happen, and you’ve kept your business logic separate from your plumbing, making these changes is no big deal. But if your business logic and your plumbing are one giant application, changes are costly and complicated, take time, require extensive testing, and are a very big deal indeed.
The following figure introduces the idea of a business service layer and a plumbing layer, also introducing the idea of specific services. The combination of business and technical layers works like this:
The Business Service layer consists of software components that provide and carry out specific business functions. In this example, the business services that will be delivered to users are order processing and credit checking.
The Plumbing layer consists of components that support the aforementioned business services by marshaling and managing actual computer resources. In this example, the components needed to handle the plumbing are the web server and the database server.
The preceding diagram illustrates the concept of dividing software applications into components that carry out business functions — business services — and components that support the use and management of computer resources — plumbing. With this breakdown, you are in a better position to reuse the narrowly defined business services in multiple ways.