Middleware PDF
Middleware PDF
Franco Zambonelli
January 2004
Universit di Modena e Reggio Emilia
Outline
{
Why Middleware?
z
What is Middleware?
z
z
Basic features
Middleware Models
{
{
{
Interaction models
Services to be provided
Implementation models
Overview of Technologies
z
z
z
J2EE
CORBA
.NET
An Example: a Problem
{
Enabling Interactions
z
z
z
Supporting Interactions
z
z
z
z
Promoting Context-Awareness
z
Where is Middleware?
{
Middleware act as an middle layer between the osware and the application software
z
z
Enables dynamicity of IP
Enables interactions to be based on names of
resources rather than on IPs
Sometimes, this enables an automatic forwarding to
the best resource
E.g., replicated web services with policies for IP
selection (Google)
Operating Systems
z
Provide high-level
abstractions for the
resources of a
computer
Facilitate and
orchestrate access to
resources
Application Software
Operating System
Hardware
Middleware
z
Provide high-level
abstractions for the
resources of a network
Facilitate and
orchestrate access to
distributed resources
Distributed Applications
Middleware
Network of Computers
9
Examples
z
z
z
Application Software
Local Middleware
Services
Operating System
Hardware
10
Servlet Sessions
z
z
JAVA as a Middleware
{
{
12
Middleware Models
{
Event-based
z
z
Shared Dataspaces
z
13
Support
z
z
Additional services
z
z
z
attribute-based discovery
Heterogeneous Interactions
Transactions, Recovery, Load Balancing, Replication
14
O2
(invoker)
(invoked)
O2 Stub
O2 Proxy
Network
15
{
{
O1
2) lookup
(invoker)
O2 Proxy
3) proxy
provided
Naming
Service
1) binding
O2
(invoked)
O2 Stub
16
Attribute-based discovery
{
An object does not bind itself to a simple name, but to a set of attributes, and
publish these attributes on the Naming service
(printer, laser, color, 8ppm)
(trains, timetable, Italy)
When another object needs specific services, it can ask to the Naming
services for objects with attributes of interest
z
This clearly makes the system more adaptive to dynamic changes and more
suitable to open systems
There is little to know in advance, most information can be obtained on-the-fly
It requires the naming service to do the pattern matching work
Heterogeneous Interactions
{
Therefore, one can think at the two objects being different in terms of
Provided that
z
z
z
z
{
{
O1 Java
(invoker)
O2 Proxy
2) Lookup
Via common
Language
Interface
Naming
Service
1)
Binding
of common language
interface
O2 C++
(invoked)
O2 Stub
Network
18
Other Services
Transactions
Synchronization
z
z
Load Balancing
z
z
Among a set of equivalent services/objects, the middleware can take care of automatically
providing a proxy to the less loaded one
Many popular Web sites (e.g., google) exploit a middleware doing this, to distributed request
among several machines
Quality of Service
Ensure that operations are served within a specific time, i.e., with a guaranteed quality
All these additional services may clearly also be present (in sligthly different forms
adapted to the model) for event-based and shared dataspace middleware systems
19
Event-based Models
{
Publish-Subscribe Model
z
z
z
z
z
20
10
Publish-Subscribe Interactions
{
O1
Event
Dispatcher
2) Publish
Event A
O2
3) Notify
To Event A
4) React
Network
21
Models of Subscriptions
{
By Name
z
z
z
By Type
z
z
z
z
By Attribute
z
z
z
Event can also contain things, i.e., additional descriptions, data, attachments
So, they can be used to pass data from one component to another, as a
message
22
11
Models of Notification
{
Synchronous
z
Asynchronous
z
In most systems
z
z
The subscribers can specify on which events of the past (how far in the past)
they are interested
Events can specify a time-to-live (lease time)
23
Time decoupling:
z
z
z
z
z
z
24
12
Context-awareness
Decoupling
{
{
Message-passing
{
Read A
Shared
DataSpace
O1
Put A
O2
Network
26
13
Data Models
{
Simple variables
z
z
Object
Structured Files
z
z
z
z
Any File
z
z
27
By Name
z
z
z
z
28
14
{
{
Any piece of data has content (i.e., values for its fields)
(int 5, String Bye Bye, char c, float 4.56);
(Tuple A)
(int 7, String Hello, char c, float 4.76)
(Tuple B)
(int 5, float 3.14, String Hello)
(Tuple C)
z
z
29
Disadvantages
z
z
Solution
z
z
z
z
z
15
Implementation Models
{
Centralized
Locally Distributed
Distributed
Totally Distributed (Peer-to-Peer)
With different types of task partitioning in
case of distributed implementations
31
Centralized Implementation
{
MW
Service
32
16
Advantages
z
z
Disadvantages
z
Computational bottleneck
Communication bottleneck
Memory bottleneck
33
Dispatcher
34
17
Mechanisms
z
z
z
z
Policies
z
z
z
35
Advantages
z
z
z
Disadvantages
z
z
z
36
18
Distributed Implementation
{
MW
Service
MW
Service
37
Advantages
z
z
z
z
Scalability
Not computation or communication bottleneck
Locality in access to services
No single point of failure
Disadvantages
z
z
38
19
Distributed Implementation:
Mechanisms and Policies
{
Mechanisms
z
z
Policies
z
39
Advantages
z
z
z
Disadvantage
z
z
z
40
20
z
z
Advantages
z
z
z
Disadvantage
z
z
Mixed Policies
z
z
z
In general
z
z
42
21
{
{
This is Peer-to-Peer
E.g., Kazaa, Gnutella, etc.
43
Policies
z
z
Advantages
z
z
Disadvantages
z
z
To be analyzed separately
44
22
CORBA
J2EE
.NET
45
CORBA
{
Based on a Distributed
Object Model
z
z
23
CORBA Components
{
ORB
z
z
z
z
z
z
Event channel
IIPO
z
z
z
J2EE
{
{
{
48
24
J2EE Architecture
49
J2EE Components
{
XML classes
Specific classes to handle and manipulate XML files
Various classes to manipulate Web-based graphical
interfaces
To publish services according to the SOAP standard
(which includes XML descriptions of services, attributes of
services, possible code attachments)
An Emerging standard for Web-based distributed object
applications
Plus:
z
z
z
z
50
25
Microsoft .NET
{
{
{
C# vs. Java
ASP vs. JSP
ActiveX vs. JavaBeans
VisualBasic vs. JavaScript
XML is XML (its a standard!!)
SOAP is SOAP (its a standard!!)
51
Autonomic Services
z
z
Semantic Services
z
User profiling
Understanding and adapting to users need and context
52
26
Readings
{
{
{
{
See Also
The Various Resources on Middleware at http://dsonline.computer.org
53
27