Chapter 3 Service Oriented Architectures
Chapter 3 Service Oriented Architectures
Computer Science
CHAPTER 3 SERVICE
ORIENTED
ARCHITECTURE
What is (Software)
Architecture?
⚫ Software architecture is the fundamental
organization of a system, embodied in its
components, their relationships to each
other and the environment, and the
principles governing its design and evolution.
- IEEE 1471-
2000
2
What is
Service ?
⚫ A mechanism to enable access to one
or more capabilities
⚫ using a prescribed interface
⚫ consistent with constraints and policies as
specified by the service description.
⚫ Windows service : RPC Locator, Event Log
⚫ Software Service: Distribution, Alert, Log
3
Service
Question -
Answer
Question/
Request
Present Audien
er ce
Answer/
Response
4
So SOA
is :
⚫ A business-centric IT architectural
approach that supports integrating your
business as linked, repeatable business
tasks, or services. - IBM
⚫ Service Oriented Architecture is a
paradigm for organizing and utilizing
distributed capabilities that may be
under the control of different
ownership domains.
5
Components of SOA
Ref: Element
of SOA SO
A
Service
Front Servic Service
End e Bus
Reposito
ry
Business Dat
Logic a
6
Architectural
Principles
⚫Loose coupling - Services maintain a
relationship that minimizes
dependencies and only maintain an
awareness of each other
⚫Service contract - Services adhere to a
communications agreement as defined
collectively by one or more service
description documents
⚫Service abstraction - Beyond what is
described in the service contract,
services hide logic from the outside
world
7
Architectural
Principles…
⚫ Service composability - Collections of services can be coordinated and
assembled to form composite services
⚫ Service autonomy – Services have control over the logic they
encapsulate
⚫ Service optimization – All else equal, high-quality services are
generally considered preferable to low-quality ones
⚫ Service discoverability - Services are designed to be outwardly
descriptive so that they can be found and assessed via available
discovery mechanisms
8
Business
Benefits
Modularity and Reusability:
SOA decomposes software systems into modular services that encapsulate
specific functionality. These services can be reused across multiple applications.
Example: A payment processing service can be reused across e-commerce
platforms, mobile apps, and point-of-sale systems.
Interoperability:
SOA promotes interoperability by enabling services to communicate with each
other using standardized protocols and data formats.
Example: A web service built using SOAP/XML can easily interact with a RESTful
service through HTTP, allowing different technologies to work together
seamlessly.
9
Business Benefits
Scalability:
◦ SOA facilitates scalability by allowing services to be distributed across
multiple servers and scaled independently based on demand.
◦ Example: A social media platform can scale its messaging service separately
from its authentication service to handle peak loads during events or
promotions.
16
Drivers
Integration Challenges:
◦ Many organizations struggle with integrating diverse applications, systems, and data
sources. SOA provides a flexible and standardized approach to integration, enabling
seamless communication between disparate systems.
◦ Example: A manufacturing company may have legacy systems for inventory
management, production control, and supply chain management. SOA allows these
systems to exchange data and collaborate effectively, improving operational
efficiency.
Legacy Modernization:
◦ Many organizations rely on legacy systems that are difficult to maintain and
enhance. SOA provides a pathway for modernizing legacy applications by
encapsulating their functionality as services and exposing them through APIs.
◦ Example: A government agency may have a mainframe system for processing tax
returns. By implementing SOA, the agency can expose tax calculation and filing
services as web services, allowing taxpayers to submit returns electronically.
Drivers
Interoperability and Collaboration:
Businesses need to collaborate with partners, suppliers, and customers
who may use different technologies and platforms. SOA facilitates
interoperability by enabling seamless communication between
heterogeneous systems.
Example: A supply chain management system integrates with logistics
providers, manufacturers, and retailers. SOA allows the system to
exchange orders, shipments, and inventory data with external partners
using standardized protocols and interfaces.
Getting to
SOA
Developing a Service-Oriented Architecture (SOA) involves several key steps
and considerations to ensure that the resulting system meets the
requirements of the business and is well-designed for scalability, flexibility,
and interoperability.
Identify Business Processes and Services:
Start by identifying the core business processes and functionalities that
need to be implemented as services. Break down these processes into
granular, reusable components that can be encapsulated within
individual services.
Example: In an e-commerce platform, core business processes may
include product catalog management, order processing, payment
processing, and user authentication.
20
Getting to SOA
Define Service Contracts and Interfaces:
◦ Define clear service contracts that specify the inputs, outputs, and behaviors of
each service. Use standards-based protocols and data formats to define service
interfaces, such as SOAP/XML or REST/JSON.
◦ Example: The service contract for an authentication service may include
methods for user login, logout, and access control, along with the expected
input parameters and response formats.
25
Service
Request -
Response Service
Director
y/
Register The Query For
Reposito Service
Service
ry
Servic Service
e
Provid Consum
er er
Invoke Service (via
Proxy)
26
Web Service Example Using
ASP.NET
<%@ WebService Language="VBScript" Class="TempConvert" %>
Imports System
Imports System.Web.Services
<WebMethod()>
Public Function CelsiusToFahrenheit (ByVal Celsius As String) As
String dim cel
cel=trim(replace(Celsius,",","."))
if cel="" or IsNumeric(cel)=false then return
"Error" return ((((cel) * 9) / 5) + 32)
end
function end
2
class
Web Service Example Using
ASP.NET
⚫ Test the Web service :
⚫ Celsius To Fahrenheit
⚫ Fahrenheit To Celsius
⚫ Remember :
⚫ SOA != Web service.
⚫ Web services can implement a service-
oriented architecture.
28
Challenges
Service-Oriented Architecture (SOA) offers numerous benefits, but it
also presents several challenges that organizations need to address to
successfully implement and maintain SOA-based systems. Here are
some challenges in service-oriented architectures:
Complexity Management:
SOA introduces additional complexity due to the distributed
nature of services, service interactions, and dependencies.
Managing this complexity requires careful design, governance,
and monitoring.
Example: In a large enterprise system, managing dependencies
between services, versioning, and ensuring backward
compatibility can become challenging as the number of services
and interactions grows.
29
Challenges
Service Discovery and Registry:
◦ Discovering and locating services dynamically within a distributed environment
can be challenging, especially as the number of services increases. Service
registries must be reliable, scalable, and up-to-date.
◦ Example: In a microservices architecture, ensuring that services can discover
and communicate with each other efficiently across different environments
(e.g., development, testing, production) requires robust service discovery
mechanisms.
33
Where Not to use SOA
Performance-Critical Systems:
◦ SOA introduces additional layers of communication and abstraction, which
can impact performance, especially in latency-sensitive or high-throughput
systems.
◦ Example: Real-time financial trading systems or online gaming platforms may
require low-latency, high-performance architectures that prioritize direct
communication and minimize overhead.