sfwr eng 3a04: software design ii · 2017-03-08 · sfwr eng 3a04: software design ii dr. r. khedri...
TRANSCRIPT
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
OutlineSFWR ENG 3A04: Software Design II
Dr. Ridha Khedri
Department of Computing and Software, McMaster UniversityCanada L8S 4L7, Hamilton, Ontario
Term 1
Acknowledgments: Material based on Software Architecture Design by Tao et al. (Chapter 10)
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Outline
Part I: Review ofPrevious Lecture
Part II: Today’sLecture
Outline of Part I
1 Model-View-ControllerMVC-IMVC-ll
2 Presentation-Abstraction-Control (PAC) Architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Outline
Part I: Review ofPrevious Lecture
Part II: Today’sLecture
Outline of Part II
3 Overview
4 Client/Server
5 Multi-tier
6 Broker Architectural Style
7 Service-Oriented Architecture (SOA)
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Model-View-Controller
Presentation-Abstraction-Control (PAC)Architecture
Part I
Review of Previous Lecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Part II
Today’s Lecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed Architecture Overview
A distributed system is a collection of computersconnected through a communication network
Data is distributedSoftware is distributedUsers are distributed
The sub-systems or components within a distributedsystem communicate with each other via
message passingremote procedure callremote method invocationetc.
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed Architecture Overview
Two important issues for designing a distributed system are:
Topology: the way in which entities connect with eachother
Mode: the method by which they communicate witheach other
SynchronousAsynchronousmessage drivencallbackevent-driven
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureClient/Server
Figure: Examples of network topologies
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed Architecture Overview
A distributed system can be modeled as a
Client/server architecture
Broker architecture
Service-Oriented Architecture (SOA)
The important features of a distributed architectureinclude
its service location transparency
service reliability and availability
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed Architecture Client/Server
The client-server model is the most commondistributed system
It is based on two communicating subsystems (usuallyrunning on different processors)
Client issues a request to the second process server
Server process receives the request, carries it out, andsends a reply to the client
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureClient/Server
Figure: Two tier client/server architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed Architecture Client/Server
AdvantagesSeparation of responsibilities such as user interfacepresentation and business logic processing
Reusability of server components
DisadvantagesLack of heterogeneous infrastructure to deal with therequirement changes
Security complications
Server availability and reliability
Testability and scalability
Fat clients
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed Architecture Multi-tier
The front tier in a multi-tier architecture is the userinterface presentation tier
The middle-tier(s) take(s) care of business logic,application decision, and execution
The back-end tier usually works on databasemanagement, or on a (virtual) machine
The advantages of multi-tier over the two-tierarchitecture are
the enhancement of reusabilityscalability by the middle tier
The middle tier can also provide multi-threadingsupports for scalability
Multi-tier architecture also reduces the traffic on thenetwork
Disadvantage: complex testability
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureMulti-tier
Figure: Three tier architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureBroker Architectural Style
The broker architecture is a middleware architecturewidely used in distributed computing
It is suitable for distributed computing that coordinatesand facilitates communication
brokering the service requestslocating proper serverforwarding and dispatching requestssending responses or exceptions back to clients
It can be used to structure distributed software systemswith decoupled components that interact by remoteservice invocations
The most important quality of this architecture =better decoupling between clients and servers
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureBroker Architectural Style
Servers make their services available to their clients byregistering and publishing their interfaces with thebroker
Clients can request the services of servers from thebroker statically or dynamically by look-up
A broker acts as a policeman in a busy intersectionwho controls and interacts with the client componentsand server components
The connection between clients and servers ismaintained by the broker
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureBroker Architectural Style
A distributed client can access distributed servicessimply by calling a remote method of a remote object
This concept is similar to unix Remote Procedure Call(RPC) and Java Remote Method Invocation (RMI)
The clients can dynamically invoke the remote methodseven if the interfaces of the remote objects are notavailable at the compilation time
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureBroker Architectural Style
Client has a direct connection to its client-proxy
Server has direct connection to its server-proxy
The proxy talks to the mediator-broker
The proxy is a well known pattern for hiding low-leveldetailed communication processing
It intercepts the client’s requestgets all argumentspackets itmarshals (streamlines) and formats the package in theformat of communication protocolsends it to the broker
A broker system is also called proxy-based system
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureBroker Architectural Style
Sub-components of a broker architecture
BrokerStub (client-side proxy): It mediates between client andbrokerSkeleton (server-side proxy)
It is statically generated by the service interfacecompilation and then deployed to the server sideIt receives the requests, unpacks the requests,unmarshals the method arguments, and calls theappropriate serviceIt also marshals results from the sever before it sends itback to the client
Bridges (Optional)Used to hide implementation details when two brokersinteroperateCan connect two different networks base don differentcommunication protocols
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureBroker Architectural Style
Figure: Broker model
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureBroker Architectural Style
Figure: Connected brokers with client/server proxy
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureBroker Architectural Style
Figure: Class diagram for broker architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureBroker Architectural Style
Figure: Sequence diagram for broker architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureBroker Architectural Style
Advantages
Server component implementation and locationtransparencyChangeability and extensibilitySimplicity for clients to access server and serverportabilityInteroperability via broker bridgesReusabilityFeasibility of runtime changes of server components(add or remove server components)
Disadvantages
Inefficiency due to the overhead of proxiesLow fault-toleranceDifficulty in testing
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureService-Oriented Architecture (SOA)
A service is a business functionality that iswell-defined and self-containedindependent from other servicespublished and available to be used via an interface
SOA services can be reused extensively regardless ofwhether they are based on new or legacy applicationsLoose coupling of service-orientation architectureprovides a great flexibility for enterprises to make useof all available service resourses
The connections between services are conducted bycommon and universal message oriented protocols suchas the SOAP Web service protocolA connection can be established statically ordynamically
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureService-Oriented Architecture (SOA)
Figure: Client with services and service directory
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureService-Oriented Architecture (SOA)
A service-oriented application might make use of manyavailable services
For that one needs a flow control language
allows specifying the sequence and logical order of thebusiness executions based on the business logic
Some services can be reused by other applications thatthey are not originally designed for
We can build a new service out of existing services
aggregation: extends one endpoint of a service to makea new interface of the new servicecontainment structure: has one interface that wraps allused services
Services can be recursively constructed to satisfy amore complex business needs (through aggr. and cont.)
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureService-Oriented Architecture (SOA)
Figure: Service composition
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureService-Oriented Architecture (SOA)
Figure: Service reuse
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureService-Oriented Architecture (SOA)
Figure: Service composition model
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureService-Oriented Architecture (SOA)
Figure: Service working model
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Distributed ArchitectureService-Oriented Architecture (SOA)
Advantages of SOA
Loosely-coupled connection
Each service component is independent from otherservices due to the stateless service feature
Interoperability: Technically any client or any servicecan access other services regardless of their platform,technology, vendors, or language implementations
Reusability: Any service can be reused by any otherservices and service is developed to be reused as well
Scalability: Loosely coupled services make themselveseasy to scale
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Client/Server
Multi-tier
BrokerArchitectural Style
Service-OrientedArchitecture (SOA)
Dr. R. Khedri SFWR ENG 3A04: Software Design II