What is Service


Each business process, as well as any process, is none other than a series of operations that run up to perform some specific operations.

Each business process, as well as any process, is none other than a series of operations that run up to perform some specific operations.

The idea behind the logic of an SOA is to make so that each specific business task is performed by a specific component called service.

A service can be defined as a unit which carries out work optimally configured for ease in access and is in the same issue. The task that performs a service defines operations, an operation intended to provide a specific output value for that operation.

Usually an input and output value is the result of the functionality provided the transaction itself.  A simple addition operation is not a good candidate for creating a service, service it is done to contain more complicated operations to ensure its existence.

The figure below shows the classic life cycle of a service:

Service Lifecicle

Figure 1 Service life-cycle

The life-cycle  represented on refers to the life cycle of a “Synchronous” and ie a service that is a response to any request, such as life-cycle of a service that makes a sum.

A service usually does not make the sum of numbers, but performs transformations of objects performing specific business rules. The idea behind this is that each service may use an object to perform more complex operations, the object is referenced for the properties of without including completely within the service.

But what is the advantage of using the services, the services allow course implement a mechanism of abstraction, so you can put together more services just make all the demands of business. This capability is provided by interfaces, using interfaces fact allows to extend the service by extending the service.

Service Interface

Figure 2 Service Interface

The services themselves do not provide any benefit, the real benefit is when you use the service throughout the corporate structure, the real benefit in fact reuse the service. The interaction of services is done using different architectural patterns, these patterns are called “Service interaction Pattern” and collect the whole family patterns that serve to determine how services interact. The main pattern of this family are:

  • Synchronous Request-Reply
  • Asynchronous Request-Reply
  • Subscription
  • Unsolicited Notification

Let us describe the various types of patterns in more detail.

Synchronous Request-Reply

This is one of the simplest patterns that exist, the pattern is very much like simple to that presented in figure 1

Figure 3 Synchronous request-reply

This is one of the easiest pattern ever, and the service needs of a single interface that is invoked to run the service, and also provides the answer service through the same interface.

Synchronus request Reply Interface

Figure 4 Interface Request-Reply

Asynchronous Request-Reply

This pattern is similar logic as above, except that the other is of type this synchronous is asynchronous. Unlike simple fact of the Request-Reply, this pattern does not wait for the answer the service provider, but will the same service provider to notify the service user the result of the operation once completed.

Figure 5 Asynchronous Request-Reply

The interface of this pattern of interaction provides two call, one by Service users who exposes for receiving the result, one by the service component to call the service method as shown in the figure.

Figure 6 Asynchronous Request-Reply interface

Subscription

The pattern that provides the subscription service user is registered with the service provider for receiving the result of the operation, the result can be only one or a series of values.

Figure 7 Subscription pattern

Once a service is registered for each service is the outcome that will be sent to the service. The interface provides this pattern as the asynchronous pattern of exposure both services are an interface for a subscription and one for reception response by the department.

Figure 8 Subscription Interface

Unsolicited Notification

The pattern Unsolacited Notification allows a service to send a message notification to a service without the need for this to halt processing for the preparation of result, a classic example of this is the junk mail.

Figure 9 Unsolacited Pattern

The interface is very easy this pattern provides a single interface, the delivery service user interface.

Figure 10 Unsolacited Interface

Conclusion

We finished the quick overview of the main patterns of interaction, as shown these patterns are very simple, but combined can provide many features complex for a SOA. In the next article we will see in detail how to implement these patterns in particularly in how interfaces can be exposed and used.