Tuesday, 30 April 2013

Service-Oriented Architecture (SOA) Design Principles


Services Design Principles

The following guidelines elaborate on services design principles for designing flexible,
extensible and maintainable systems
Services Design Principles
The following guidelines elaborate on services design principles for designing flexible,
extensible and maintainable systems
1.       Services are named to maximize consumability - Services should be named using
  nouns, operations should be named using verbs.
2.       Services have well-chosen granularity - To determine service granularity while
  designing services, consider factors like maintainability, interoperability, consumability, and    
  performance.
3.       Services are cohesive and complete - The noun-verb naming convention for services
  and operations tends to help us focus on the functional cohesiveness of the service
  interface. We can ask the question, "Is the verb something that the noun does?”
  Completeness is particularly relevant when creating a service for a known consumer
  and the focus is on meeting the requirements of the consumer.
4.       Services encapsulate implementation details - The OO design principle encapsulation
  also applies to designing service interfaces. By encapsulating details of service
  implementation -- the algorithms and resources used -- the decoupling between
  service consumer and provider is improved and hence future flexibility is improved.
5.       Services accommodate multiple invocation patterns - service technologies enable a
  further level of encapsulation. A service consumer can use identical coding techniques to   
  invoke services using a variety of different invocation patterns such as
A) Synchronous invocation using SOAP over HTTP(S),
                        B) Asynchronous, messagebased invocation using SOAP over JMS
                        C) Local invocation using Java method calls.
6.       Services can have stateless interfaces - Careful service design can avoid the need for
  stateful conversations and simplify the implementation of a scalable, reliable SOA
  infrastructure.
7.        Stateful services can be modeled using state transitions - A technique for increasing
  consumability is to create service interfaces reflecting the states of the business life
  cycle.
8.       Service operations represent business actions - We should define operations with
  specific business meanings rather than generic operations.
9.       Service operations have coarse-grained parameters - We recommend using coarsegrained  
  parameters for creating flexible operations, enabling new versions of the
  operation to be provided without worrying about existing consumers.
10.   Service operations are designed for concurrency - We recommend the use of an
  optimistic locking strategy, delegating responsibility for concurrency control to
  appropriate application logic.


Monday, 29 April 2013

SOA Governance


What is SOA Governance?
SOA governance refers to the processes used to oversee and control the adoption and implementation of service-oriented architecture (SOA) in accordance with recognized practices, principles and government regulations.


SOA governance consists of three major components:
a registry, a policy and a testing procedure:

  • SOA registry is an evolving catalog of information about the available services in the SOA implementation. The registry allows businesses to efficiently discover and communicate with each other.
  • SOA policy is a set of behavioral restrictions intended to ensure that services remain consistent and do not conflict with each other. These constraints also ensure that good engineering practices, common-sense customer relations principles and government laws are followed. A specific person may be designated to grant occasional policy exceptions.
  • SOA testing is a comprehensive schedule of audits and performance-monitoring procedures intended to ensure that the entire SOA solution is efficient, cost-effective, secure and up-to-date.
Features of SOA Governance

v  Automated discovery, mapping, and management of the service inventory and associated relationships
v  Visualization of services and composite applications runtime and design time
v  Access to services in production, plus those still in development
v  Visibility, lifecycle, and change management of assets and applied policies
v  Enforcement of governance via approvals and policy management
v  Tracking and reporting of reuse throughout the entire service lifecycle
v  Support for critical decisions based on compliance, performance, and ROI metrics



SOA Patterns


Example SOA Patterns

          Basic principle:
        n separate processes better than one
          Communication:
        asynchronous query
        command facade
          Data integration:
        VETO: Validation, Enrich, Transform, Operate
        2 step XRef
        Forward Cache
        Federated query
1. Asynchronous Query Pattern
          Problem: long execution times for queries
        due to Internet
        due to distributed systems
          Solution:
        de-couple request/response
        use caching of results
2. The VETO Pattern
          Problem: invoking a service usually involves:
        Extract data, modify, convert format, validate
          Solution:  Separate actions into a 4-action pipeline
          Actions
        Validate (the XML document)
          Simplifies data validation for subsequent steps
        Enrich
          Adding value to the data
        Transform
          To a target format
        Operate
          Interacts with the target service
          Variation:
        VET(R)O, where R = Route 


3. The 2 Step XRef Pattern
          Problem: Integration may involve
        Content transformation
        Structure transformation
          Content-level transformation between source and target can be achieved:
        By single, complex process
        By two separate processes
          One to transform to an abstracted form of target
          Second to transform to the specific target

4.  Federated Query Patterns
          Federated query
        Multiple queries on different data sources
          Cache pushing may not be appropriate:
        If data changes regularly
        If out-of-date data is acceptable
          E.g., newsfeeds cached once an hour
          Queries may take variable amounts of time
          Example patterns:
        Cache pull (federated query) pattern
        Long duration request (federated query) pattern