Nagarro, Inc. – For SAP SOA design and development, it is important to understand the best practices for identifying the granularity and technical characteristics of the enterprise service. In this blog, we provide essential design principles and best practices for designing such enterprise services.
Design Principles for service design and identification:
1.Granularity: The service should have a broad level functionality to be sufficiently useful to a large range of consumers. The service should not be too fine-grained i.e. not have a narrow functionality to be of use to a limited set of consumers.
2.True reuse at the Enterprise level: The service should have functionality to be of use across the enterprise by providing generic functionality in its functional domain.
3.Durable (standing the test of time/change in the landscape): A good service would stand the test of time and the test of constant change in the enterprise landscape.
Best Practices for Technical Characteristics
1.Idempotent: The Service should provide the same result when called more than once. In web service operations, due to technical failures, the caller may not get a valid reponse to its service invocation. The caller would invoke the business service again, which would lead to a repeated business transaction (an obvious blunder). Hence, for transactions, we have to ensure that the business transaction happens only once. A design approach is to use a unique GUID in the web service call, which would be used in the service response to correlate the request-response. In case of a repeated service invocation, the duplicate call would get detected due to the repetition of the unique GUID parameter.
2.Security Considerations: Considering the broad appeal of the service across the enterprise, many consumers are expected to invoke the service. Hence, it is important to control the security aspects of calling this business service such as roles, authentication and authorization. Even if the service is not a transaction (not committing any business data) and if it is a read-only service, the security has to be controlled to restrict the data subset being requested by the caller.
3.Error Control: Due to the distributed nature of services and participation in distributed business processes, the service should fail elegantly and provide a human-readable trace to provide an easy method to troubleshoot error causes. Additionally, the service should reverse-compensate any business data transactions on encountering errors and preserve data integrity.
The above are the essential aspects for designing good services that endure the test of time. These learnings are based on our direct experience in identifying enterprise services and establish SOA design and governance principles across customer projects.
Manish Agarwal, SAP Program Manager, Nagarro, Inc.