1
Service Layer Patterns
Introduction to Software Architecture Jay Urbain, Ph.D. urbain@msoe.edu
References: Please review last slide
Service Layer Patterns Introduction to Software Architecture Jay - - PowerPoint PPT Presentation
Service Layer Patterns Introduction to Software Architecture Jay Urbain, Ph.D. urbain@msoe.edu References: Please review last slide 1 2 Service-oriented architecture (SOA) Style of software design where services are provided to the
1
References: Please review last slide
2
– The basic principles of SOA are independent of vendors, products and technologies. – A service is a discrete unit of functionality that can be accessed remotely and acted upon and updated independently, such as retrieving a credit card statement online.
3
1. It logically represents a business activity with a specified
2. It is self-contained. 3. It is a black box for its consumers 4. It may consist of other underlying services.
4
5
SOA Data Loader - UI/Presentation - Integration Gateway Service Layer Business/Domain Model Data Source Layer
6
Service layer – Defines and implements:
Should never expose details of the internal processes or the business entities used within the application.
– Services expose a service interface to which all inbound messages are sent. – Think of a service interface as a façade that exposes the business logic implemented in the application (typically, logic in the business layer) to potential consumers. Think Use Cases.
– When exchanging data across the service layer, data structures are wrapped by message structures that support different types
– The services layer will also (usually) include data types and contracts that define the data types used in messages.
7
8
9
– Trend is toward building applications out of fine-grained (micro- services). – Defining service operations that are too fine grained can result in performance or scalability problems.
– For example, provide an operation that returns an appropriately sized subset of the data.
10
11
12
13
14
15
– Cache an identifier for incoming messages, and use message replay detection to identify and reject messages that match an entry in the replay detection cache.
16
Reference:
Messaging Solutions by Gregor Hohpe & Bobby Woolf.
17
– Data loaders – UI’s: Web, Mobile – Integration Gateways – Admin, etc.
18
using the same semantics as a Web application.
the actions that can be performed against a resource are defined by using HTTP verbs such as GET, POST, PUT, and DELETE.
HTTP operations against a URI, which is typically in the form of an HTTP-based URL.
state for that resource.
can move to from the current resource.
19
composed of an XML envelope that contains a header and body.
performed by the service. – For example, a header may contain security, transaction, or routing information.
define the service and the actions it can perform.
you can utilize higher-performance protocols such as TCP.
and reliability.
20
reach their destination, but also that those messages have not been read or modified during transit.
back ability in the case of a failure.
services or decoupled layers of an application. It excels at providing an interface between new and legacy systems on an internal network.
API-type interaction with the system without having to redesign the system to expose a ReST resource model.
21
22
23
24
25
26
– CRUD – create, read, update, and delete. – Almost 1-to-1 correspondence between CRUD use cases and service layer operations. – Still can be complex: object notification, event generation, etc.
27
28
29
– Evolving work – review remaining slides. – Original work: Alistair Cockburn’s “Application Boundary Pattern.”
30
STOP
31
32
each other.
33
34
business functionality.
strict.
– Existing application assets and other programs (the Operational Systems layer); – Software components that help to perform services and may leverage existing assets (the Service Components layer); – The services that are in the service portfolio, and hence available for use in solutions, including through discovery and composition (the Services layer); – Business processes, and service compositions that they use, including
– The people and external systems that participate in the business processes, and their interfaces to the services (the Consumers layer).
35
functionality, but do not support each other in a strictly layered hierarchy.
– Integration of other building blocks (the Integration layer); – Quality aspects of system operation (the Quality of Service layer); – Information (the Information layer); and – Governance (the Governance layer).
36
relations management”, “customer database”, “internal accounting”, and “settlement” in this layer. They include: – Applications and data stores with functionality required to deliver the service functionality in the Service Layer; and – Infrastructure programs such as operating systems, database management systems, and runtime environments.
37
that help to perform services.
supported by building blocks in this layer.
– Programs that “wrap” the programs in the operational systems layer to create services; – Programs that are written to perform services and deliver the service functionality themselves; and – Groups of such programs.
38
decoupling in the system.
from consumers.
service component provides a point at which compliance with the service contract can be monitored or enforced.
39
detail to enable a consumer to invoke the functions exposed by the service provider.
basic service feature of SOA.
“identify eligible customer account”, “validate transfer”, “submit transfer”, “move funds”, and “complete transfer”.
40
example, “move funds” might be composed of other portfolio services including “move funds from source” and “move funds into destination”.
design, you are likely to be dealing with groups of related services rather than individual services. An example of such a group might be “funds transfer services”.
– The portfolio services themselves; – Compositions in which portfolio services are composed of other portfolio services; – Groups of services and compositions covering functional areas; – Data created or used by the portfolio services; and – Service descriptions, contracts, and policies.
41
“transfer funds”.
and of portfolio services. For example, “transfer funds” might be composed of other business processes including “create transfer” and “process transfer”.
composed of portfolio services. For example, “create transfer“ might be composed of portfolio services including “submit transfer“ and “move funds“.
– The business processes themselves; – Compositions in which business processes are composed of other business processes and of portfolio services; and – Information created or used by the business processes.
42
interface to the portfolio services. Examples might be “customer” and “on-line banking portal”.
– People, organizations and programs that take part in the business processes (the consumers); – Interface programs that present information to and accept information from the consumers, such as channels, portals, other human-computer interface programs, format converters, and interface configuration programs; – Data used by the interface programs, such as user profiles and interface configurations.
43
and communication between other building blocks.
which adds flexibility to the architecture.
processing, service composition and service discovery features of SOA are supported by building blocks in this layer.
44
monitoring and management of the quality of service of the architected system, including its performance, security, and manageability.
features of SOA are supported by building blocks in this layer.
managers, security managers, and configuration managers.
45
transformation and management of data.
building blocks in this layer.
– Information models; – Vocabularies; – Data models; – Data representation models; – Programs that expose data as services; – Data search engines; – Data mining engines; and – Document management systems.
46
and operational governance.
– Governance rules and procedures; and – Services and programs that support the application of the rules and the operation
47 1. Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions by Gregor Hohpe & Bobby Woolf. 2. "Service-oriented modeling and architecture: How to identify, specify and realize your services," by Ali Arsanjani (developerWorks, Nov 2004) 3. Note: The infrastructure required of a SOA at run time must provide communication, invocation, and quality of service between adjacent layers in an SOA. 4. "Requirements-Driven Dynamic Services Composition for Web Services and Grid Solutions," by Liang-Jie Zhang and Bing Li. (Journal of Grid Computing; 2(2): 121-140. 2004) 5. "SOA programming model," by Donald Ferguson and Marcia Stockton (developerWorks, Jun 2005) 6. Web Services Description Language (WSDL) Version 2.0 Part 1: Core Language is available at http://www.w3.org/TR/2006/CR-wsdl20-20060327, by R. Chinnici, J-J. Moreau, A. Ryman, S. Weerawarana (World Wide Web Consortium, Mar 2006). The latest version (Mar 2007) of WSDL Version 2.0 Part 1: Core Language is available at http://www.w3.org/TR/wsdl20. 7. "The modular structure of complex systems," by D. L. Parnas, P. C. Clements, and D. M. Weiss. (IEEE Transactions on Software Engineering, SE-11(3): 259-266. 1985.) 8. Software Architecture: Perspectives on an Emerging Discipline, by M. Shaw and D. Garlan. (Prentice-Hall, 1996) 9. "Explicit Representation of Service Semantics: Towards Automated Composition Through a Dynamically Reconfigurable Architectural Style for On Demand Computing," by Ali Arsanjani. (proceedings of the International Conference on Web Services; pp 34 - 37; 2003.) See ICWS 2003.)