http://www.developer.com/design/article.php/3736851/Achieving-Situational-Awareness-in-Enterprise-Services.htm
Service Oriented Architecture (SOA) is an architecture paradigm that supports the creation of business services that incorporate common enterprise-worthy business behaviors that are expressed by a re-usable interface and are governed by policies. Given that business services are not tied to the implementation but to common business semantics have enterprise-wide applicability; these business services are capable of being discovered by the end users as opposed to "finding" these services by having to drill through terse and complex Application Programming Interface(s) or APIs. In addition, having business definitions of services that are "advertised" on an enterprise-wide platform promotes the concept of re-use of business services. This in turn leads to promoting business agility because business offerings are assembled from re-usable services instead of being built. Among the stated benefits of SOA is the separation of the interface from the implementation of the service. The preservation of the interface can be referred to as interface durability. A byproduct of decoupling service definition from service implementation and deployment in a SOA-based service deployment model is enhanced service interoperability. In other words, the implementation of the "published" interface can be provisioned via software components that could be written in any language or be deployed on any platform as long as they adhere to the service interface and are available for remote access. Despite all of the benefits, global multi-national enterprises face a special challenge in leveraging SOA as the architecture paradigm for deploying foundational services. Specifically, the concept of interface durability becomes the core issue. Being that enterprises that are typically spread across multiple geographic zones, they also are governed by multiple regulatory agencies. These types of enterprises find it challenging to adhere to common business service definitions, due to the vast diversity of "situational" and "locale" variances. This then opens up the need for an architecturally sound way to handle the "operational" diversity in a manner that enterprise-class services would need to support without breaking interfaces or replicating services. I will introduce the Situational Awareness Injection Service Pattern to help those architects looking for an innovative, architecturally sound way to handle business variation in enterprise class services without the need for breaking interfaces or replicating services. This article tries to demonstrate how an enterprise can deal with locale-based adaptation without impacting the concept of interface durability. The pattern also shows how enterprises can improve their responsiveness and enhance business agility to deal with the inevitable change in today's business environments. This article assumes that the reader is a SOA practitioner and that this article is not a SOA primer. Neither is this article attempting to justify SOA as an architectural paradigm. A basic understanding of the concepts of externalized Rules Processing is assumed. In addition, the article proceeds under the assumption that there is a strong relationship between the service interface and the business payload (referred to henceforth as a business entity or a business concept) being returned by the service operation. The service consumer context is considered to be the input to the service provider whereas the service consumer context adapted business concept is considered to be the outcome of the service invocation. It should be noted that this article does not discuss the design constructs that could be utilized by the service provider to implement non-enterprise worthy or business-area specific business behavior. Whether the model includes the use of a rules engine that expresses business unit specific algorithms or else if the model leverages a service adapter, service gateway, or service broker pattern to identify and route the call to the specific service implementation layer is left up to the application architects' expertise. The article considers any of the previously mentioned design models as appropriate for incorporating business-area specific business logic. I will use the following business scenario to illustrate the problem domain. A global financial company has multiple divisions, such as a brokerage division, loans division, credit division, retail banking division; all of these divisions have a common need for getting customer account information. The assumption in this case is that this enterprise-worthy business concept is accessed via requests that are made to a common enterprise class "informational access business service." Even though the various divisions of an enterprise such as this may have the need for customer account information, there are some core differences in what aspects of customer account information is needed for making further "business context"-specific decisions. Depending on the business division and the calling consumer, context retrieval of one or more aspects of the customer account information is governed by contextual business rules, regulatory rules, and locale specific business rules. Furthermore, associative business concepts that are needed to populate the customer account business attributes may be impacted by "business-area specific" rules. These may include business concepts such as the customer credit profile, customer preferences, and the customer profitability business concept definitions. In all cases, either the final customer account business entity attribute values or base attributes may be altered based on the business context, regulatory domain, and the "localized business" rules that govern the particular business subsidiary or business division. The purpose of this article is to outline a strategy that would allow enterprise-class business services and the business concept payloads that are returned by them to be applicable and re-used across the enterprise's multiple business areas. There is also an attempt made to come up with some design and implementation strategies that allow the service behavior to be re-used while accommodating the "situational" behavioral changes. To this end, I demonstrate how to incorporate localized business context, locale-driven regulatory policies, and regional influences into a common enterprise service by externalizing locale-specific rules and policies. Further, I show how these variant business rules can be incorporated at deploy time or runtime to deliver maximum business agility. The proposed solution also enables re-use of the service implementation layer, thus making a more compelling case to adhere to a common interface definition for a business service such as the customer account informational service that has cross-enterprise applicability. As mentioned above, SOA is a vehicle to achieve business agility. However, this does not mean that an enterprise and specifically a service consumer do not have to react to locale-specific rules and policies. Before you embark on defining the actual architectural pattern, you will review a few alternate design and implementation models that can be employed to accomplish this goal. The following approaches point to various degrees of re-use that can be applied to the design and implementation of a service as a solution to accommodate "situational" variance: It should be noted that these alternative models are documented in the order of increased flexibility and enhanced re-usability of the service interface and the service implementation layers. Pros: Cons: Pros: Cons: Pros: Cons: Making an enterprise service locale aware allows both the enterprise level rules and the locale-specific rules to be incorporated in honoring a service call. However, to preserve the code base, I propose a model that externalizes volatile business rules (regulatory policies and locale-specific business rules). This model keeps the service interface and the service implementation layers constant because the service implementation layer does not hard wire business rule definition and business rule interpretation logic in the code base. This model also allows all layers of the service stack—in other words, the service interface and service implementation layer—to be re-used to deliver a consistent and robust solution. At the same time, context-specific rules are applied by the service provider and not by the service consumer. This then helps in making the service truly business friendly. Furthermore, creating a configurable "situationally"-aware service allows specific QoS policies to be applied, thus enabling the service provider to deliver context relevant business solutions. The service model presented here shows how the attribution of both the information model and the canonical message interchange model is driven via the use of a metadata. Additionally, the attribute values are arrived at via the use of a business user friendly rules engine framework. In this model, the service could either just return a business concept if it is just an information access service or else, in a more sophisticated service, it could also wrap a common business function. If a business function is being wrapped, the externalized rules would apply to the creation of the business concept attribute-set and the order in which regulatory rules are executed to alter the attribute values. Here, the assumption is that the end result of a business function execution is the creation of a "context specialized" business concept that is adapted to deal with the "situational rules" governing the consumer business context. It must be noted that only those service interface-based operations that need volatile "situational" rules are impacted by the need to interpret external rules. This type of selective rules engine interaction enables the service implementation to be optimized to honor the consumer requests. Rules governing how the business concept is populated and which algorithms are used are all encapsulated in the business service. These could be embedded in the business logic layer if these are stable, enterprise-worthy rules. On the other hand, in the case of volatile departmental rules, these could be defined in a business rules engine and these could be incorporated into the business logic layer at runtime. The algorithms and the rules are all encapsulated in the service and are easy to change in a consistent fashion. For instance, the enterprise may define the algorithm that is implemented in the service to be consistently applied. For example, customer profitability may be calculated to be a ratio of the sales factual information and payment history. The service implementation process logic may take on multiple paths depending on the consumer context. The service provider also uses the consumer usage context to insure that only the relevant information is returned based on the needs of the consumer. This could also dictate what the consumer is allowed to view. The service provider also may be able to use this same usage context to optimize the amount of processing performed and the amount of information returned. Also, the provider may be able to make a determination on whether the information that is embedded in the payload needs to be encrypted and certified depending on whether the consumer is an internal or an external third-party requestor. Again, the semantics of the service invocation may vary based on the consumer usage context. The following key architectural components are leveraged in any multi-tiered, SOA-compliant model. The layers are service consumer layer, service mediation layer, service provider layer, and the service implementation layer. In addition to these logical architectural layers, the metadata repository is leveraged to accomplish the contextual adaptation and business variation being described. Figure 1: Description of the core component interactions in the "Situational Awareness Injection" pattern Figure 2: Core architecture components of a Service Implementation Layer The following are the key to achieving a dynamic business concept attribute set, attribute values, and business function behavior. The following business and service characteristics are the some of the key traits of the use case that could leverage this pattern. The following caveats need to be kept in mind to prevent over dependence and over use of this pattern. As can be seen, contextual information such as business divisions and/or regulatory influences can all affect the service behavior and the population of the business concept. The "situational awareness injection" pattern leverages an external rules engine to apply rules to the service implementation layer. The service interface is retained across the enterprise despite the need to support variances in operational contexts across the multiple business divisions. These externalized business rules are based on the business context of the consumer and are applied to alter the behavior of the business service while preserving the service interface. The business context is supplied either by the service consumer in the request or it is provided to the business service as part of the "configuration" or is embedded as an environmental parameter supplied during the deployment of the service. Regardless of where the context comes from, this pattern enables not only the ability of insulating the consumer from the rules and policy changes but also allows the encapsulation of all of the "situational" business rules in the service, thus making it easy for the enterprise or the business division to alter the rules without impacting the business consumers. The reader will conclude that their company should seriously investigate applying the Situational Awareness Injection Service pattern. This includes the identification of business services fitting the Situational Awareness Injection Service pattern and the identification of required infrastructure services and runtime assets that might be needed to enable contextual variation without having to undertake service replication. The architecture model presented here has great applicability in the realm of SaaS-style service offerings as well as in a service grid market place. The core architecture model and the interactions defined in this article promote the service interface preservation while allowing variations in cross-divisional business concept information. These variations may be needed to support situational behavior resulting from changes to regulatory policies or to the business unit-operating environment. Surekha Durvasula is an enterprise architect who has had 10 plus years experience in designing and architecting a variety of enterprise applications in the financial services sector and the retail industry vertical. Most of her work has been in the area of distributed N-tiered architecture, including JEE component architecture. Her more recent focus has been on Service Oriented Architecture, Business Process Management, and Business Architecture. Her efforts as an Enterprise Architect involve not only architecting new applications and business services but also in leveraging the principles of SOA to extend the life of existing Enterprise Information Systems. She currently manages the Enterprise Architecture Group that involves establishing the discipline of Enterprise Architecture for the organization including preparing the organization to take advantage of the concepts of Service Orientation. In an enterprise that uses the Customer Account information as a common business entity, the following divisions/lines of business all could leverage the same business service: The Customer Account business entity-based attributes and values are impacted by diverse the user communities needs and by the disparate operational business contexts that are needed by business divisions and/or regulatory policies. Furthermore, there is a possibility that these business variations influence the associative Customer Account business entities. For example, the Brokerage division may need Customer Preference and Customer Service Election aspects and the marketing division may just need the Customer Profitability aspect of the Customer Account. Further, the Loan/Mortgage and Credit divisions may need Customer Profitability and Customer Credit Scores. The Customer Credit Score allows the Loans/Mortgage division to assess "Risk Exposure" ratios. Customer Profitability could be considered an aggregated attribute value that is derived from the Credit Score and the Customer History attributes. The Marketing department may be given a Customer Profitability Range to help create targeted campaigns, but may not be given access to the Credit Score. Again, the information that is returned to the consumer is dependent on the usage context. It is this context that helps the service layer determine whether a numeric customer score is to be returned or else if a customer classification is returned. The usage context of the Marketing department is authorized only to get the Customer Profitability customer classification such as platinum, gold, or the silver status and not a customer credit score. The business context can be obtained from the incoming request or from the deployment environment parameter. This is used as a reference by the business service to populate the business entity as the operating business context causes the appropriate rules to fire in the service. Business context also can be used to suppress a subset of business attributes for which the service consumer may not be authorized. This suppression of attributes may limit what the service consumer has access to and may occur in response to the application of business unit-level policies. To respond to these business unit level policies, the service provider may have rules in the service implementation layer that get triggered when the specific business context is encountered. This could be manifest in the customer example where the customer social security number or credit scores are returned only to the Mortgage or the Credit business units while a "Marketing" business unit context renders these attributes to be suppressed. In addition, the business usage context could be used to selectively return only information that is expensive in terms of size of the payload or in terms of the processing required to build the payload. This business usage context allows the service provider to honor specific service invocations. By extension, depending on the specific business context the service can return either granular information or else it can return aggregated high level information. Thus, this business context can be used to determine the level of processing needed in the service implementation layer without impacting response time for all of the consumers. For example, in the business context of the service desk or the retail personal banker, the service may return transaction history for open issues/inquiries, but the same level of information is not returned in the marketing consumer. On the other hand, in the case of the investment banking usage context, the customer preferences and customer service elections may be returned to improve personalization of services being offered to the end users. In other cases, the business usage context may be used to perform additional business behavior. In the retail banking context, information may return information based just on the income information and the Credit Division context may force the service provider to enlist an external credit agency to get the credit scores. A call made to the service with a Mortgage may have to provide additional information to assess the customer risk prior to arriving at the mortgage rate. The infrastructure services and runtime assets used to implement pattern (Rules engine, Metadata Repository, Rule Caches and indexing algorithms, ESB, and so on). Figure B1: Setup and Rule or Policy Change behavior Figure B2: Setup and Rule Policy Change behavior Figure B3: Runtime behavior Figure B4: Runtime Behavior
Achieving Situational Awareness in Enterprise Services
March 27, 2008
Introduction
Objective
Assumptions
Business Scenario Overview: Business Reasoning to Support the Need for the Situational Awareness Injection Pattern
Note: Appendix A details the Customer Account example in far greater detail.
Possible Alternative Business Service Options to Deal with Operational Variance Among Business Divisions
A. Creating a new service interface and service implementation. Some by code level re-use may be achieved by copying and modifying the implementation code base
B. Extending the service allows retaining the service interface while altering the service implementation
C. Applying the "Situational Awareness Injection Pattern" to retain both the service interface and service implementation
Overview of the Situational Awareness Injection Pattern
Description of the "Situational Awareness Injection" Pattern
Architecture Tiers of a Standard SOA Model

Click here for a larger image.

Click here for a larger image.
Note: Appendix B defines the interactions of the infrastructure components in the setup view and runtime views that help to demonstrate how the architecture components work together to support the concepts of the Situational Awareness Injection service pattern.
Checklist to Identify Conditions of Applicability of the Situational Awareness Injection Pattern
Caveats of Over Indulgence in Using the Situational Awareness Injection Pattern
Conclusion and Next Steps
About the Author
Appendix A: Business Scenario
Customer Account: Applying the Situational Awareness Injection pattern
Appendix B: Diagrams of the Infrastructure Service Interactions
Overview of the Setup and Rule or Policy Change Interactions

Click here for a larger image.

Click here for a larger image.
Overview of the Runtime Interactions

Click here for a larger image.

Click here for a larger image.