thammanoon kawinfruangfukul csse ms, id: 1584488782 middleware

36
Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

Upload: rhoda-maxwell

Post on 24-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

Thammanoon Kawinfruangfukul

CSSE MS, ID: 1584488782

Middleware

Page 2: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

2

Agenda What is middleware? Middleware Vs. Frameworks Middleware requirements Middleware categories Examples of middleware From architecture to Implementation Resolving mismatches Summary

Page 3: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

3

What is middleware?

Infrastructure that supports (distributed) component-based application development

independent software system

mechanisms to enable component communication

mechanisms to hide distribution information

Examples: CORBA, COM/DCOM/COM+, Java Message Service (JMS), etc.

Page 4: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

4

What is middleware? (cont.)

Standard for constructing and interconnecting components

interchange upgrade adaptation aggregation

Page 5: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

5

What is framework?

software structure supporting various types of application domain

application-level

embodies architectural styles

incomplete software system; Fill in the blank

Examples: Symfony, MFC, etc.

Page 6: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

6

Middleware Vs. Frameworks

Similarity: Both provide developers with services not

available in the underlying OS/language

Difference: Frameworks

• provide a software structure which embodies a software architectural design.

Middleware • provides infrastructure to support application.• helps application with lower-level facilities• implemented outside of application

Page 7: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

7

Middleware requirements Network communication

• Helps different components in different hosts communicate with each other

• Provides data transformation

Coordination• Provides synchronization when components

communicate with each other. Synchronous, deferred synchronous, and

asynchronous communication.• Provides activation policies and manages persistent

storage of components’ state.• Provides threading policies to control concurrent requests

Page 8: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

8

Middleware requirements (cont.) Reliability

• Communication between two components Best-effort, at-most-once, at-least-once, and exactly-once

• Communication among group requests K-reliability, time-outs, and totally-ordered requests

• Replicating component Scalability

• Ability to accommodate a growing future load. Access, location, migration, and replication

transparency Heterogeneity

• Supports interoperate between different hardware and operating system platforms, programming languages, and middleware

Page 9: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

9

Middleware categories Transactional

• two-phase commit for distributed transactions• e.g., IBM’s CICS, BEA’s Tuxedo

Message-oriented (MOM)• communication via message exchange• e.g., MQSeries and Sun’s Java message queue

Procedural• remote procedure calls as the foundation• e.g., Sun RPC, DCE RPC

Object-based• communication among and via distributed objects• e.g., CORBA, COM, RMI

Component-based • support for distributed components• e.g., EJB

Page 10: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

10

Examples of middleware

• Sun RPC • CORBA• IBM’s CICS• MQSeries• Prism-MW

Page 11: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

11

SUN RPC The caller process sends a call message and waits for the reply. On the server side a process is dormant awaiting the arrival of

call messages.

Difference between RPCs and local procedure calls

• Use of global variables as the server• Performance may be affected by the transmission times.• User authentication may be necessary.• Location of server must be known.

Page 12: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

12

Remote Procedure Call Model

Page 13: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

13

Portmap

Page 14: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

14

CORBACommon Object Request Broker Architecture

A middleware platform that supports a standardized OO architecture for software applications

CORBA supports distributed object computing

CORBA does not require an underlying OO implementation

It uses a broker• an intermediary handling requests in a system• facilitates communication between clients and server objects• separates a component’s interface from its implementation

Communication Invoke methods via RPCs Both synchronous and deferred synchronous communication

Page 15: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

15

Main CORBA Features Object request broker (ORB)

OMG interface definition language (IDL)

Language mappings

Stubs and skeletons

Interface repository

Dynamic invocation and dispatch

• dynamic invocation interface

• dynamic skeleton interface

Object adapters

Page 16: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

16

CORBA Architecture

Page 17: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

17

IBM’s CICSCustomer Information Control System

Page 18: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

18

MQSeries (IBM WebSphere MQ)

MQSeries at Run Time

Page 19: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

19

MQSeries: Message Queues

Message queues support both synchronous and asynchronous communication

Header (ID and Control) + Data

Page 20: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

20

MQSeries: Message Queue Manager

Message queue manager provides the message queuing interface (MQI) for communication with applications

Page 21: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

21

Prism-MWFor programming-in-the-small-and-many setting

Architectural middleware for distributed, resource constrained, mobile, and embedded systems

Supports architecture-based software development• Architecture-based software development is the

implementation of a software system in terms of its architectural elements

• Enabling a direct mapping between an architecture and its implementation

Modular design

Page 22: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

22

Prism-MW

IComponentIConnector

AbstractMonitorScaffold

AbstractDispatcher

Round RobinDispatcher

AbstractScheduler

FifoScheduler

Brick

Architecture

AbstractTopology

ExtensibleComponent

Component

Connector

AbstractHandler

ExtensiblePort

ExtensibleEventEvent

Port

IPort

Abstract EventExtensions

...

Abstract PortExtensions

...

ExtensibleConnector

ExtensibleArchitecture

Serializable

AwarenessExtensions

...

IArchitecture

#mutualPort

AbstractImplementation

...Application

Specific Impl.

Abstract ConnBehaviorAbstract

AwarenessAbstract Comp

Behavior

Page 23: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

IComponentIConnector

Scaffold

AbstractDispatcher

Round RobinDispatcher

AbstractScheduler

FifoScheduler

Brick

Architecture

ExtensibleComponent

Component

Connector

Event

Port

IPort

Serializable

IArchitecture

#mutualPort

23

Prism-MW’ Core

Page 24: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

24

Prism-MW: Ports

Page 25: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

Architecture - ARCH

class Arch { static public void main(String argv[]) { Architecture arch = new Architecture (“ARCH");

// create componentsComponentA a = new ComponentA ("A");ComponentB b = new ComponentB ("B");ComponentD d = new ComponentD ("D");

Component BComponent A Component D

// create connectorsConnector conn = new Connector("C");

CConnector C

// add components and connectors arch.addComponent(a);arch.addComponent(b);arch.addComponent(d);arch.addConnector(conn);

Component BComponent A

Component D

CConnector C

// establish the interconnectionsarch.weld(a, conn);arch.weld(b, conn);arch.weld(conn, d)

}}

25

Using Prism-MW

Page 26: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

Component B handles the event and sends a response

public void handle(Event e){

if (e.equals("Event_D")) {... Event e1= new Event("Response_to_D");e1.addParameter("response", resp);send(e1);}...

}

Send

(e1)

Architecture - ARCH

Component BComponent A

Component D

CConnector C

Component D sends an event

Event e = new Event ("Event_D");e.addParameter("param_1", p1);send (e);

Send

(e)

26

Using Prism-MW (2)

Page 27: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

From architecture to Implementation

27

Page 28: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

28

Possible solutions:

Mapping an Architecture to an Implementation

Code generation

Middleware technology

Page 29: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

29

Mapping an Architecture to an Implementation(2)

29

Comp 1

Comp 2

Async Event

Comp 1

Comp 2

RPC

(thread)

(thread)

Architecture

Implementation

Page 30: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

Resolving mismatches A style is chosen first, but the middleware selected for

implementation does not support (or contradicts) that style

A middleware is chosen first (or independently) and has undue influence on the architectural style used

Strategies Change or adapt the style Change the middleware selected Develop glue code Leverage parts of the middleware

and ignore others Hide the middleware in components/connectors

Use the middlewareas the basis fora framework

Page 31: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

31

Summary Middleware

Middleware requirements Network communication, Coordination, Reliability,

Scalability, and Heterogeneity

Middleware categories Transactional, Message-Oriented, Procedural, and Object

and Component middleware

Examples of middleware

From architecture to Implementation Hiding middleware in connector

Page 32: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

32

ReferencesTaylor , R.N; Medvidovic , N.; Dashofy , E.M.; , “Software Architecture: Foundations, Theory, and Practice,” Wiley, 2009.

Emmerich, W.: “Software engineering and middleware: a roadmap”. In: Proceedingsof the conference on The future of Software engineering (ICSE 2000) - Future ofSE Track, Limerick, Ireland, ACM Press (2000) 117–129

D. Wackerow, "MQSeries Primer," IBM Redpaper, REDP- 0021-00, IBM Corporation (1999), http://www.redbooks. ibm.com/abstracts/redp0021.html?Open.

M.B Juric, I Rozman, M Hericko, “Performance comparison of CORBA and RMI”, Information and Software Technology, Volume 42, Issue 13, 15 September 2000, Pages 915-933

CICS TransactionServer fromStart to Finish http://www.redbooks.ibm.com/abstracts/sg247952.html?Open accessed on March 30, 2012

Remote Procedure Call (RPC) http://www.pms.ifi.lmu.de/mitarbeiter/ohlbach/multimedia/IT/IBMtutorial/3376c410.html accessed on March 30, 2012

Malek, S.; Mikic-Rakic, M.; Medvidovic, N.; , "A style-aware architectural middleware for resource-constrained, distributed systems," Software Engineering, IEEE Transactions on , vol.31, no.3, pp. 256- 272, March 2005

Medvidovic, N.; ,“On the Role of Middleware in Architecture-Based Software Development”. In 14th International Conference on Software Engineering and Knowledge Engineering (SEKE), pages 299–306, 2002.

Page 33: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

IBM’s CICS

Backup Slides

Page 34: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

34

The CICS transaction flow

Page 35: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

35

The CICS transaction flow (2)

Page 36: Thammanoon Kawinfruangfukul CSSE MS, ID: 1584488782 Middleware

36

The CICS transaction flow (3)