Building Reusable Services

Download Building Reusable Services

Post on 01-Nov-2014




2 download

Embed Size (px)


Introduction to SOA, business rationale for service orientation, and techniques for building reusable services.


<ul><li> 1. Building Reusable Services for your SOA Vijay Narayanan </li> <li> 2. Agenda <ul><li>Brief introduction to SOA </li></ul><ul><li>Business Rationale for Reusable Services </li></ul><ul><li>Building Reusable Services </li></ul><ul><li>Recent Trends Shaping Services Strategy </li></ul></li> <li> 3. About Me <ul><li>Technical lead for data services and business processes </li></ul><ul><li>Working in financial services for 7+ years </li></ul><ul><li>Software Reuse Evangelist </li></ul><ul><li>Blogger: http:// / </li></ul></li> <li> 4. What is SOA? <ul><li>SOA stands for Service Oriented Architecture (Yes, yet another TLA!) </li></ul><ul><li>Services are software capabilities using new and legacy assets </li></ul><ul><li>Goals increase business/IT alignment, reduce integration costs, increase revenue by building new products/services </li></ul><ul><li>When web services are used to realize SOA they bring increased interoperability via open standards such as HTTP, XML </li></ul><ul><li>Pursuing SOA must be a conscious decision - requires retooling, change in developer mindset, refactoring of legacy processes, governance, operating model for internal teams to use/engage with etc. </li></ul>Different folks will give you different answers! </li> <li> 5. Why Pursue SOA? <ul><li>Aligned to business goals not simply a technology approach </li></ul><ul><li>Transparency into business processes and technology assets </li></ul><ul><li>Release new products and services into the marketplace </li></ul><ul><li>Reduce integration costs with new projects and initiatives </li></ul><ul><li>Based on open standards (for the most part!) and tools provided by several technology vendors </li></ul><ul><li>Leverage legacy systems and their capabilities </li></ul><ul><li>Integration along the length and breadth of a business capability including partners, suppliers, and internal players. </li></ul>Reuse is a key reason why enterprises pursue SOA! </li> <li> 6. Reusable Services Generate New Revenue <ul><li>Create new products and services faster using existing services as-is or reusing them as part of orchestrations (quicker time to market) </li></ul><ul><li>Charge internal and external clients either via a chargeback model or a subscription-based pricing model </li></ul><ul><li>Generate growth by hosting services on behalf of other groups/teams </li></ul><ul><li>Provide opportunity for cross-sell/up-sell across customer touchpoints. With reusable services, this will result in a consistent client experience </li></ul></li> <li> 7. Reusable Services Help Reduce Costs <ul><li>Reduce development, maintenance, and testing costs as you integrate new applications and business processes </li></ul><ul><li>Reduce cost of ownership by migrating clients off legacy platforms/processes </li></ul><ul><li>Reduce number of redundant service capabilities spread across teams </li></ul><ul><li>Over time, will result in architecture convergence across business processes and applications that leverage a common set of reusable services </li></ul><ul><li>Migrate service capabilities to cheaper service providers and not impact every application. </li></ul></li> <li> 8. Some Foundational Concepts <ul><li>A service capability provides tangible value to the enterprise </li></ul><ul><li>Building a service inventory for a specific domain involves much less risk compared to an enterprise wide inventory </li></ul><ul><li>Identify and organize service capabilities based on business domain (continuously seek subject matter expertise!) </li></ul><ul><li>Dont mix domain specific service capabilities with domain agnostic ones i.e. they should be separate services </li></ul><ul><li>Plan to support multiple versions full blown service versions or service capabilities. Every consumer wont use the version you want at the same time! </li></ul><ul><li>Most ideas when for succeeding with reusable code applies to service capabilities as well </li></ul></li> <li> 9. Building Reusable Services <ul><li>Decouple channel-specific from channel-agnostic logic </li></ul><ul><li>Provide standard interfaces for services </li></ul><ul><li>Offer standardized publications </li></ul><ul><li>Apply cross cutting concerns horizontally </li></ul><ul><li>Ensure services avoid needless coupling </li></ul></li> <li> 10. Decouple Channel-specific from Channel-agnostic logic <ul><li>Avoid service parameters bound to a specific transport protocol. Examples of transport specific parameters - HTTP request headers, JMS Headers </li></ul><ul><li>Offer service capability across multiple transports (e.g. HTTP and JMS) </li></ul><ul><li>Offer service capability across multiple message exchange patterns (E.g.: Synchronous request/reply via HTTP and JMS, Asynchronous request/reply via JMS) </li></ul><ul><li>Encapsulate channel-specific business rules and behavior Note: Different channels might need different levels of robustness/SLA! </li></ul></li> <li> 11. Provide Standard Interfaces for Service Access <ul><li> Standard interface also referred to as Service Mediation </li></ul><ul><li>Decouples service providers and service consumers </li></ul><ul><li>Hook cross cutting concerns (e.g. authentication/logging) </li></ul><ul><li>Wrap legacy capabilities </li></ul><ul><li><ul><li>Translate legacy syntax and semantics </li></ul></li></ul><ul><li><ul><li>Alignment of legacy interfaces with strategic enterprise contracts </li></ul></li></ul><ul><li>Offer value added capabilities for performance tuning (e.g. caching, dynamic resource allocation), service level agreement (SLA) adherence) </li></ul></li> <li> 12. Offer Standardized Publications <ul><li>Avoid one-off or point to point integrations </li></ul><ul><li><ul><li>If there is a consumer-specific message required subscribe to standard message and then transform to specific format </li></ul></li></ul><ul><li>Publish standard event messages from both coarse-grained and fine-grained services. </li></ul><ul><li><ul><li>Entity services publish creates/updates to critical data </li></ul></li></ul><ul><li><ul><li>Business Processes or task services publish milestones and business exceptions. </li></ul></li></ul><ul><li>Publications can be offered in conjunction with a subscription model (e.g. publish only a subset of events based on business rules or policies) </li></ul></li> <li> 13. Apply Cross Cutting Concerns Horizontally <ul><li>Cross cutting concerns apply to several capabilities (e.g. authentication, encryption/decryption, logging, metrics, error handling) </li></ul><ul><li>Several ways to integrate service capabilities with these </li></ul><ul><li><ul><li>Configuration (XML/properties files or database driven) </li></ul></li></ul><ul><li><ul><li>Template Method Pattern (recipes to process requests with hooks to cross cutting concerns) </li></ul></li></ul><ul><li><ul><li>Using a container with support for aspect orientation </li></ul></li></ul><ul><li>Decouple business logic from these horizontal functions. No different than aspect oriented programming where aspects are applied before and after method. </li></ul></li> <li> 14. Ensure Services Avoid Needless Coupling <ul><li>Service capabilities can easily inherit unwanted coupling! </li></ul><ul><li>Avoid or at least minimize: </li></ul><ul><li><ul><li>Vendor specific coupling (platform specific headers/parameters/service contracts, transports) </li></ul></li></ul><ul><li><ul><li>Legacy coupling (legacy data, semantics, error codes) </li></ul></li></ul><ul><li><ul><li>Transport and Channel specific coupling (covered earlier) </li></ul></li></ul><ul><li><ul><li>Consumer specific coupling (contract specific to consumer system or usage) </li></ul></li></ul></li> <li> 15. a few tips for the road <ul><li>Recognize that building reusable services is an iterative process! You have to continuously align project after project </li></ul><ul><li>All this talk about service decoupling, mediation, standard publications are really about the fundamentals of good design </li></ul><ul><li><ul><li>Loose Coupling </li></ul></li></ul><ul><li><ul><li>Encapsulation </li></ul></li></ul><ul><li>Use Before Reuse </li></ul><ul><li><ul><li>Dont build a service capability unless there is a consumer </li></ul></li></ul><ul><li><ul><li>Iteratively build capabilities based on business priorities </li></ul></li></ul><ul><li><ul><li>Plan to refactor capabilities at least once before making it fit for reuse </li></ul></li></ul></li> <li> 16. Where Are Services Headed? <ul><li>Cloud Computing rightsource service capabilities, reduce fixed costs, and utility-like billing/subscription </li></ul><ul><li>Software As a Service (SaaS) model </li></ul><ul><li>Tighter alignment with the Business Process Management (BPM) and messaging strategies </li></ul><ul><li>Event Driven Architecture </li></ul><ul><li>REST-based service design in addition to Web Services </li></ul><ul><li>Enterprise Service Bus (ESB) deployments </li></ul></li> <li> 17. </li> </ul>