SWE 4210 Part 5 v2

Télécharger au format pdf ou txt
Télécharger au format pdf ou txt
Vous êtes sur la page 1sur 26

SWE 4210

Part 5: Service-oriented Architecture

Chapter 19 Service-oriented architecture 1


Topics covered

 Services as reusable components


 Service engineering
 Software development with services

Chapter 19 Service-oriented architecture 2


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.
Chapter 19 Service-oriented architecture 3
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

Chapter 19 Service-oriented architecture 4


Service-oriented architecture

Chapter 19 Service-oriented architecture 5


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

Chapter 19 Service-oriented architecture 6


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

Chapter 19 Service-oriented architecture 7


Web service standards

Chapter 19 Service-oriented architecture 8


RESTful web services

 Current web services standards have been criticized as


‘heavyweight’ standards that are over-general and inefficient.
 REST (REpresentational State Transfer) is an architectural
style based on transferring representations of resources from
a server to a client.
 This style underlies the web as a whole and is simpler than
SOAP/WSDL for implementing web services.
 RESTFul services involve a lower overhead than so-called
‘big web services’ and are used by many organizations
implementing service-based systems that do not rely on
externally-provided services.

Chapter 19 Service-oriented architecture 9


Services scenario

 An in-car information system provides drivers with


information on weather, road traffic conditions, local
information etc. This is linked to car radio so that
information is delivered as a signal on a specific radio
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.

Chapter 19 Service-oriented architecture 10


A service-based, in-car information system

Chapter 19 Service-oriented architecture 11


Advantage of SOA for this application

 It is not necessary to decide when the system is


programmed or deployed what service provider should
be used or what specific services should be accessed.
▪ As the car moves around, the in-car software uses the service
discovery service to find the most appropriate information
service and binds to that.
▪ Because of the use of a translation service, it can move across
borders and therefore make local information available to people
who don’t speak the local language.

Chapter 19 Service-oriented architecture 12


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

Chapter 19 Service-oriented architecture 13


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

Chapter 19 Service-oriented architecture 14


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)

Chapter 19 Service-oriented architecture 15


Organization of a WSDL specification

Chapter 19 Service-oriented architecture 16


WSDL specification components

 The ‘what’ part of a WSDL document, called an interface,


specifies what operations the service supports, and
defines the format of the messages that are sent and
received by the service.
 The ‘how’ part of a WSDL document, called a binding,
maps the abstract interface to a concrete set of
protocols. The binding specifies the technical details of
how to communicate with a Web service.
 The ‘where’ part of a WSDL document describes the
location of a specific Web service implementation (its
endpoint).

Chapter 19 Service-oriented architecture 17


Part of a WSDL description for a web service

Define some of the types used. Assume that the namespace prefixes ‘ws’
refers to the namespace URI for XML schemas and the namespace prefix
associated with this definition is weathns.
<types>
<xs: schema targetNameSpace = “http://.../weathns”
xmlns: weathns = “http://…/weathns” >
<xs:element name = “PlaceAndDate” type = “pdrec” />
<xs:element name = “MaxMinTemp” type = “mmtrec” />
<xs: element name = “InDataFault” type = “errmess” />

<xs: complexType name = “pdrec”


<xs: sequence>
<xs:element name = “town” type = “xs:string”/>
<xs:element name = “country” type = “xs:string”/>
<xs:element name = “day” type = “xs:date” />
</xs:complexType>
Definitions of MaxMinType and InDataFault here
</schema>
</types> Chapter 19 Service-oriented architecture 18
Part of a WSDL description for a web service

Now define the interface and its operations. In this case, there is only a single
operation to return maximum and minimum temperatures.
<interface name = “weatherInfo” >
<operation name = “getMaxMinTemps” pattern = “wsdlns: in-out”>
<input messageLabel = “In” element = “weathns: PlaceAndDate” />
<output messageLabel = “Out” element = “weathns:MaxMinTemp” />
<outfault messageLabel = “Out” element = “weathns:InDataFault” />
</operation>
</interface>

Chapter 19 Service-oriented architecture 19


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.

Chapter 19 Service-oriented architecture 20


The service engineering process

Chapter 19 Service-oriented architecture 21


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 and WSDL
service interfaces.
 Service implementation and deployment, where you
implement and test the service and make it available for
use.

Chapter 19 Service-oriented architecture 22


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.

Chapter 19 Service-oriented architecture 23


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.

Chapter 19 Service-oriented architecture 24


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 Expenses form
checker Student application
Web form to XML form
converter

Chapter 19 Service-oriented architecture 25


Key points

 Service-oriented software engineering is based on the notion that


programs can be constructed by composing independent services
which encapsulate reusable functionality.
 Service interfaces are defined in WSDL. A WSDL specification
includes a definition of the interface types and operations, the
binding protocol used by the service and the service location.
 Services may be classified as utility services, business services or
coordination services.

Chapter 19 Service-oriented architecture 26

Vous aimerez peut-être aussi