university of british columbia software practices lab introduction to middleware for software...

18
University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

Post on 18-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

University of British Columbia

Software Practices Lab

Introduction to

Middleware for Software

Engineering Eric Wohlstadter

539D

Page 2: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

What is Middleware?

• Mediates heterogeneities (differences)– Defines standard protocols for distributed

computing

• Abstracts details of using protocols– Programmers use abstractions– Abstractions implement protocols

• Provided as off-the-shelf software– Not traditionally integrated in the operating

system

Page 3: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

Problems with Distribution

Page 4: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

Some Middleware Categories

• Remote Procedure

• Object-oriented

• Component Containers

• Message-oriented

Page 5: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

Procedural Middleware

• Problems Addressed– Tedious to build distributed applications with sockets

• Heterogeneous data types• Memory management (buffers)• Network failures

• Approach– Compiler generated socket code

• Socket code becomes the “assembly language”

• Examples– Sun RPC– SOAP

Page 6: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

RPC Approach

• Define function signatures using an interface definition language (IDL)

• IDL ensures compatibility across platforms

Page 7: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

RPC Approach

PL6

PL2

PL5

PL1

PL4

PL3 PL6

PL2

PL5

PL1

PL4

PL3IDL

Text and Graphics from Prof. Wolfgang Emmerich, University College, London

Page 8: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

RPC Approach

• IDL is compiled into generated stubs

Page 9: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

Object Middleware

• Problem Addressed– Tedious to build distributed applications with RPC

• Extensibility is hard• Difficult to manage stateful resources

• Approach – Distributed Objects

• Examples– CORBA– Java RMI– DCOM

Page 10: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

Object Approach

• Interface inheritance allows server to add new features without invalidating clients

• Client can create and destroy instances of objects which live on server

• Client maintains distinct stub instances for each distributed object

• Objects can be migrated and/or replicated

Page 11: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

Containers

• Problem Addressed– Hard to manage crosscutting concerns

• Approach – Declarative Services– O/R Mapping

• Examples– Enterprise Java Beans– COM+ (.NET)– Spring Framework

Page 12: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

CORBA-style method

transfer(int amount,int account1, int account2) {/* Apply access control *//* Signal beginning of transaction *//* Update Database for account1 *//* Update Database for account2 *//* Signal Commit or Rollback of Transaction */

}

Programmer must handle persistence, transactions, security…

Page 13: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

EJB-style method

@TransactionAttribute(REQUIRED)@ Interceptor(AccountSecurity.class)

transfer (int amount, Account account1, Account account2) {

/* Update Account 1 */

/* Update Account 2 */

}

Many details taken care of by container

Page 14: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

How the container intervenes

EJB

EJBContainer

EJBRemoteobject

EJBContainerServices

Page 15: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

Message-Oriented Middleware• Problems Addressed

– High-coupling between client and server

• Approach– Message Queuing

• Temporal Decoupling– Pub-Sub

• Referential Decoupling– Can be combined

• Examples– MSMQ– MQSeries

Page 16: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

Point-to-Point

Page 17: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

Pub-Sub

Messages delivered through router infrastructure

Deliver is based on topic subscriptions

Router Router

PublisherSubscriber

Subscriber

NEC && AMD

IBM

IBM

Page 18: University of British Columbia Software Practices Lab Introduction to Middleware for Software Engineering Eric Wohlstadter 539D

Conclusion

• Evolution of RPC to Containers and MOM

• We will look at…– Using AOP to implement middleware– Applying AOP to distributed application

programming– Distributed AOP– Designing new kinds of middleware (mobile,

P2P, service-oriented)