0% found this document useful (0 votes)
22 views61 pages

Tme4093 Soa

Book
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views61 pages

Tme4093 Soa

Book
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

Service Oriented

Architecture

TME4093: Advanced Topic in Software Engineering


Topic Covered

• Service-Oriented Architecture (SOA)


• Service Engineering
• Service Composition

Chapter 18 Service-oriented software engineering


Web services

 A web service is an instance of a more general notion of a service:


“an act or performance offered by one party to another. Although the process may be
tied to a physical product, the performance is essentially intangible and does not
normally result in ownership of any of the factors of production”.
 The essence of a service, therefore, is that the provision of the service
is independent of the application using the service.
 Service providers can develop specialized services and offer these to a
range of service users from different organizations.
 Example of web services:
 SOAP, REST, XML-RPC, JASON-RPC, GraphQL
3
Example of web services

4
Reusable services

Services are reusable components that are independent (no


requires interface) and are loosely coupled.
A web service is:
▪ A loosely coupled, reusable software component that encapsulates
discrete functionality, which may be distributed and programmatically
accessed.
▪ A web service is a service that is accessed using standard Internet and
XML-based protocols.
Services are platform and implementation-language independent

5
Benefits of service-oriented approach

❑ Integration of Services:
• Services can be provided by internal or external service providers.
• Organizations can build applications by integrating a variety of services from multiple
providers.
❑ Service Accessibility:
▪ Service providers publish information about their services.
▪ Authorized users can utilize these services seamlessly.
❑ Dynamic Service Binding:
▪ Applications can delay the binding of services until deployment or execution.
▪ This flexibility allows applications to be reactive and adapt to changes in their execution
environment.

6
Benefits of a service-oriented approach

Opportunistic Construction of New Services


❑ Innovative Service Creation:
▪ Service providers can identify and create new services by combining existing ones in novel ways. (eg:
weather forecasting service )
Pay-per-Use Model
❑ Cost Efficiency:
• Users pay for services based on usage rather than ownership.
• Eliminates the need to purchase rarely-used components, reducing costs (eg: e-commerce site ).
Optimized Application Design
❑ Smaller Applications:
• Ideal for mobile devices with limited processing and memory capabilities.
Offloading Processing:
❑ Computationally-intensive tasks can be offloaded to external services, enhancing performance (eg: mobile
photo editing app ).

7
Service Example - Services scenario

 An in-car information system provides drivers with information on weather,


road traffic conditions, local information etc. This is linked to car audio system
so that information is delivered as a signal on a specific channel.
 The car is equipped with GPS receiver to discover its position and, based on
that position, the system accesses a range of information services.
Information may be delivered in the driver’s specified language.

8
Intelligent Information Systems in Modern Cars

9
Key Components and Features Of An In-Car Information System Based On
SOA

Service Registry

Service Providers

Service Consumers

Middleware

Service Orchestration

Standards and Protocols

10
Service Example –
A service-based, in-car information system

11
Service Example –
Advantage of SOA for this application

 Dynamic Service Utilization in In-Car Systems


▪ Flexible Service Binding:
• No need to decide on service providers or specific services at the time of programming or
deployment.
▪ Service Discovery:
• As the car moves, in-car software uses a service discovery service to find and bind to the most
appropriate information services dynamically.
▪ Translation Service:
• Enables access to local information across borders.
• Provides information in different languages, making it accessible to users who do not speak the
local language.

12
Service-oriented software engineering

❑ Significant Development:
• Comparable in importance to object-oriented development.
❑ Enhanced Cooperation:
• Enables companies and organizations to collaborate by utilizing each other’s business functions.
❑ Flexible Application Construction:
• Applications can be built by linking services from various providers.
• Supports the use of standard programming languages or specialized workflow languages.

13
Service-oriented architecture

14
What is Service-oriented architecture?

15
Service-oriented architectures

A means of developing distributed systems where the


components are stand-alone services
Services may execute on different computers from different
service providers
Standard protocols have been developed to support service
communication and information exchange

16
Service-oriented architecture

17
Benefits of SOA

Services can be provided locally or outsourced to external


providers
Services are language-independent
Investment in legacy systems can be preserved
Inter-organisational computing is facilitated through simplified
information exchange

18
Key standards

SOAP
▪ A message exchange standard that supports service
communication
WSDL (Web Service Definition Language)
▪ This standard allows a service interface and its bindings to be
defined
WS-BPEL
▪ A standard for workflow languages used to define service
composition

19
Application of SoA to Online Retail

20
Application of SoA to Education

21
Web service standards

22
23
Service-oriented software engineering

Existing approaches to software engineering have to


evolve to reflect the service-oriented approach to software
development
▪ Service engineering. The development of dependable, reusable
services
• Software development for reuse
▪ Software development with services. The development of
dependable software where services are the fundamental
components
• Software development with reuse
24
Services as reusable components

A service can be defined as:


▪ A loosely-coupled, reusable software component that encapsulates
discrete functionality which may be distributed and programmatically
accessed. A web service is a service that is accessed using standard
Internet and XML-based protocols
A critical distinction between a service and a component as
defined in CBSE is that services are independent
▪ Services do not have a ‘requires’ interface
▪ Services rely on message-based communication with messages
expressed in XML

25
Web Service Description Language

The service interface is defined in a service description


expressed in WSDL (Web Service Description Language).
The WSDL specification defines
▪ What operations the service supports and the format of the
messages that are sent and received by the service
▪ How the service is accessed - that is, the binding maps the
abstract interface onto a concrete set of protocols
▪ Where the service is located. This is usually expressed as a URI
(Universal Resource Identifier)

26
Service engineering

27
Service Engineering

 The process of developing services for reuse in service-oriented


applications
 The service has to be designed as a reusable abstraction that can be
used in different systems.
 Generally useful functionality associated with that abstraction must be
designed and the service must be robust and reliable.
 The service must be documented so that it can be discovered and
understood by potential users.

28
The Service Engineering Process

29
Stages Of Service Engineering

Service candidate identification, where you identify possible services


that might be implemented and define the service requirements.

Service design, where you design the logical service interface and its
implementation interfaces (SOAP and/or RESTful)

Service implementation and deployment, where you implement and


test the service and make it available for use.

30
Service Candidate Identification

 Services should support business processes.


 Service candidate identification involves understanding an organization’s
business processes to decide which reusable services could support
these processes.
 Three fundamental types of service
▪ Utility services that implement general functionality used by different business
processes.
▪ Business services that are associated with a specific business function e.g., in a
university, student registration.
▪ Coordination services that support composite processes such as ordering.

31
Task and Entity-Oriented Services

Task-oriented services are those associated with some activity.


Entity-oriented services are like objects. They are associated
with a business entity such as a job application form.
Utility or business services may be entity- or task-oriented,
coordination services are always task-oriented.

32
Service Classification

Utility Business Coordination

Task Currency converter Validate claim form • Process expense


Employee locator Check credit rating claim
• Pay external supplier

Entity Document style checker Expenses form


Web form to XML converter Student application
form

33
Service identification

1. Is the service associated with a single logical entity used in


different business processes?
2. Is the task one that is carried out by different people in the
organisation? Can this fit with a RESTful model?
3. Is the service independent?
4. Does the service have to maintain state? Is a database
required?
5. Could the service be used by clients outside the organisation?
6. Are different users of the service likely to have different non-
functional requirements?
34
Service Identification Example

 A large company, which sells computer equipment, has arranged special


prices for approved configurations for some customers.
 To facilitate automated ordering, the company wishes to produce a
catalog service that will allow customers to select the equipment that they
need.
 Unlike a consumer catalog, orders are not placed directly through a
catalog interface. Instead, goods are ordered through the web-based
procurement system of each company that accesses the catalog as a
web service.
 Most companies have their own budgeting and approval procedures for
orders and their own ordering process must be followed when an order is
placed. 35
Catalog Services

Created by a supplier to show which good can be ordered from


them by other companies
Service requirements
▪ Specific version of catalogue should be created for each client
▪ Catalogue shall be downloadable
▪ The specification and prices of up to 6 items may be compared
▪ Browsing and searching facilities shall be provided
▪ A function shall be provided that allows the delivery date for ordered items to
be predicted
▪ Virtual orders shall be supported which reserve the goods for 48 hours to
allow a company order to be placed 36
Catalogue: Non-functional requirements

 Access shall be restricted to employees of accredited organisations


 Prices and configurations offered to each organisation shall be confidential
 The catalogue shall be available from 0700 to 1100
 The catalogue shall be able to process up to 10 requests per second

37
Functional descriptions of catalog service operations

Operation Description

MakeCatalog Creates a version of the catalog tailored for a specific


customer. Includes an optional parameter to create a
downloadable PDF version of the catalog.
Lookup Displays all of the data associated with a specified catalog
item.
Search This operation takes a logical expression and searches the
catalog according to that expression. It displays a list of all
items that match the search expression.

38
Functional descriptions of Catalog Service Operations

Operation Description
Compare Provides a comparison of up to six characteristics
(e.g., price, dimensions, processor speed, etc.) of up
to four catalog items.
CheckDelivery Returns the predicted delivery date for an item if
ordered that day.
MakeVirtualOrder Reserves the number of items to be ordered by a
customer and provides item information for the
customer’s own procurement system.

39
Service interface design

Involves thinking about the operations associated with the


service and the messages exchanged
The number of messages exchanged to complete a
service request should normally be minimised.
Service state information may have to be included in
messages

40
Example: E-Commerce Order Processing Service
Step Operation Description Message Exchanges State Information
Step 1: Define Operations placeOrder Allows a customer to place a new A single message containing all The response includes an order
order. necessary order details. confirmation with the order ID and
initial status.
checkOrderStatus Allows a customer to check the A single message containing the The request includes the order ID;
current status of their order. order ID to get the status. the response includes the current
status and any updates.
cancelOrder Allows a customer to cancel an A single message containing the The request includes the order ID
existing order. order ID and cancellation reason. and the cancellation reason; the
response confirms the cancellation
and the final status of the order.
Step 2: Minimize Message placeOrder A single message containing all
Exchanges necessary order details.

checkOrderStatus A single message containing the


order ID to get the status.

cancelOrder A single message containing the


order ID and cancellation reason.
Step 3: Include State placeOrder The response includes an order
Information confirmation with the order ID and
initial status.
checkOrderStatus The request includes the order ID;
the response includes the current
status and any updates.
cancelOrder The request includes the order ID
and the cancellation reason; the
response confirms the cancellation
41
and the final status of the order.
42
43
Interface Design Stages

Logical interface design


▪ Starts with the service requirements and defines the operation names and
parameters associated with the service. Exceptions should also be defined
Message design (SOAP)
▪ For SOAP-based services, design the structure and organisation of the input
and output messages. Notations such as the UML are a more abstract
representation than XML
▪ The logical specification is converted to a WSDL description
Interface design (REST)
▪ Design how the required operations map onto REST operations and what
resources are required. 44
Catalog interface design

Operation Inputs Outputs Exceptions

MakeCatalog mcIn mcOut mcFault


Company id URL of the catalog Invalid company id
PDF-flag for that company
Lookup lookIn lookOut lookFault
Catalog URL URL of page with Invalid catalog
Catalog number the item number
information
Search searchIn searchOut searchFault
Catalog URL URL of web page with Badly formed search
Search string search results string
45
Catalog interface design

Operation Inputs Outputs Exceptions


Compare compIn compOut compFault
Catalog URL URL of page showing Invalid company id
Entry attribute (up to 6) comparison table Invalid catalog number
Catalog number (up to 4) Unknown attribute
CheckDelivery cdIn cdOut cdFault
Company id Catalog number Invalid company id
Catalog number Expected delivery date No availability
Number of items required Zero items requested
MakeVirtualOrder poIn poOut poFault
Company id Catalog number Invalid company id
Number of items required Number of items required Invalid catalog number
Catalog number Predicted delivery date Zero items requested
Unit price estimate
Total price estimate 46
Service Implementation And Deployment

Programming services using a standard programming language


or a workflow language
Services then have to be tested by creating input messages
and checking that the output messages produced are as
expected
Deployment involves publicising the service and installing it on
a web server. Current servers provide support for service
installation

47
Legacy System Services

Services can be implemented by implementing a service


interface to existing legacy systems
Legacy systems offer extensive functionality and this can
reduce the cost of service implementation
External applications can access this functionality through
the service interfaces

48
Service Descriptions

Information about your business, contact details, etc. This is


important for trust reasons. Users of a service have to be
confident that it will not behave maliciously.
An informal description of the functionality provided by the
service. This helps potential users to decide if the service is
what they want.
A description of how to use the services SOAP-based and
RESTful.
Subscription information that allows users to register for
information about updates to the service. 49
Service composition

50
Software Development with Services

Existing services are composed and configured to


create new composite services and applications
The basis for service composition is often a
workflow
▪ Workflows are logical sequences of activities that, together,
model a coherent business process
▪ For example, provide a travel reservation services which
allows flights, car hire and hotel bookings to be coordinated

51
Vacation package workflow

52
Service construction by composition

53
Construction By Composition

Formulate outline workflow


▪ In this initial stage of service design, you use the requirements for the
composite service as a basis for creating an ‘ideal’ service design.
Discover services
▪ During this stage of the process, you search service registries or catalogs
to discover what services exist, who provides these services and the
details of the service provision.
Select possible services
▪ Your selection criteria will obviously include the functionality of the
services offered. They may also include the cost of the services and the
quality of service (responsiveness, availability, etc.) offered.
54
Construction By Composition

Refine workflow.
▪ This involves adding detail to the abstract description and perhaps adding
or removing workflow activities.
Create workflow program
▪ During this stage, the abstract workflow design is transformed to an
executable program and the service interface is defined. You can use a
conventional programming language, such as Java or a workflow
language, such as WS-BPEL.
Test completed service or application
▪ The process of testing the completed, composite service is more complex
than component testing in situations where external services are used.
55
Testing Service Compositions

Testing is intended to find defects and demonstrate that a


system meets its functional and non-functional
requirements.
Service testing is difficult as (external) services are ‘black-
boxes’. Testing techniques that rely on the program
source code cannot be used.

56
Service testing problems

External services may be modified by the service provider thus


invalidating tests which have been completed.
Dynamic binding means that the service used in an application
may vary - the application tests are not, therefore, reliable.
The non-functional behaviour of the service is unpredictable
because it depends on load.
If services have to be paid for as used, testing a service may be
expensive.
It may be difficult to invoke compensating actions in external
services as these may rely on the failure of other services
which cannot be simulated. 57
Key points

 Service-oriented architecture is an approach to software engineering where


reusable, standardized services are the basic building blocks for application
systems.
 Services may be implemented within a service-oriented architecture using a
set of XML-based web service standards. These include standards for
service communication, interface definition and service enactment in
workflows.
 Alternatively, a RESTful architecture may be used which is based on
resources and standard operations on these resources.
 A RESTful approach uses the http and https protocols for service
communication and maps operations on the standard http verbs POST,
GET, PUT and DELETE. 58
Key points

 Utility services provide general-purpose functionality; business


services implement part of a business process; coordination services
coordinate service execution.
 Service engineering involves identifying candidate services for
implementation, defining service interfaces and implementing, testing
and deploying services.
 The development of software using services involves composing and
configuring services to create new composite services and systems.
 Graphical workflow languages, such as BPMN, may be used to
describe a business process and the services used in that process.
59
60
Homework
1. How can the company leverage existing third-party services to build their
travel booking platform using SOA? Illustrate the process with the key steps
involved.
2. What are the benefits of using SOA for the travel booking platform, and how
can the company ensure the legacy systems are integrated into this new
architecture? Provide a step-by-step approach.
3. Service-Oriented Architecture (SOA) and Cloud Computing Architecture are
two distinct concepts in the realm of software architecture and IT
infrastructure. List THREE(3) similarities and differences of both.

Chapter 18 Service-oriented software engineering 61

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy