Anda di halaman 1dari 53

Message-based MVC Architecture for Distributed and Desktop Applications

Xiaohong Qiu

Department of Electrical Engineering and Computer Science Syracuse University

March 2, 2005

Xiaohong Qiu

Presentation Topics
Background for My Research Architecture of Message-based MVC SVG Experiments Performance Analysis Collaboration Paradigms Conclusion and Future work

March 2, 2005

Xiaohong Qiu

Background
General area is technology support for Synchronous and Asynchronous Resource Sharing.
e-learning e-science e-business e-entertainment (e.g. video/audio conferencing) (e.g. large-scale distributed computing) (e.g. virtual organizations) (e.g. online game)

Grids
manage and share (typically asynchronously) resources (people, computers, data, applications etc.) or distributed services in a centralized fashion.

Web Services
define loosely coupled software components across internet interacting with messages.

Peer-to-Peer Grids
link services, resources and clients in dynamic decentralized fashion.
The system consists of a sea of message-based Services (e.g. shared SVG as a Web Service) Services linked by publish/subscribe messaging infrastructure (e.g. NaradaBrokering)

March 2, 2005

Xiaohong Qiu

Classic Grid Architecture


IBM

Database
Laser Printer

Database

Resources
Supercomputer

Comupting

File Server

Netsolv e Computing Content Access

Security

Collaboration
Compositio n

Middle Tier Brokers Service Providers

Middle Tier becomes Web Services

Clients
Laptop
Cellular Phone
Cellular phone

PDA

Desktop

Workstation

Java Ring

March 2, 2005

A centralized organization Xiaohong Qiu

Peer to Peer Grids

File Server

Workstation
Database

User Facing Web Service Interfaces


Laptop

Peers
PDA
Brokers
Event/Messag e Brokers

Brokers Brokers
Event/Messag e Brokers

Java Ring

Brokers

Service Facing Web Service Interfaces

IBM

Peers
Laser Printer

Supercomputer
Database

Cellular phone

Comupting

Desktop

Cellular Phone

March 2, 2005

A democratic organization Xiaohong Qiu

Research on a generic model of building applications


Application domains
Distributed (Web)
Service Oriented Architecture and Web Services

Desktop (client)
Model-View-Controller (MVC) paradigm

Internet collaboration
Hierarchical Web Service pipeline model

Motivations
CPU speed (Moores law) and network bandwidth (Gilders law) continue to improve bring fundamental changes Internet and Web technologies have evolved into a global information infrastructure for sharing of resources Applications getting increasingly sophisticated
Internet collaboration enabling virtual enterprises large-scale distributed computing

Requires new application architecture that is adaptable to fast technology changes with properties
March 2, 2005 Xiaohong Qiu 6

Summary of the situation


The Internet has evolved into stability
TCP/IP network stack dominating the communication protocol domain; IP forms the low-level sphere surrounding hardware network core

Construction of distributed operating system over the Internet is not completed


It keeps adding new functionalities to the general purpose platform One current effort focuses on building of messaging infrastructure tailored for disparate applications

Evolution of application architectures


client-server model Multi-tier (e.g. three-tier) model A variety of distributed model (e.g. Java RMI, CORBA, COM/DCOM, J2EE, .NET) Grids Peer-to-peer Web Services and SOA

Web application deployment shows diverse directions but have common features
User interfaces Services for the sharing of information and resources (e.g. through unicast and multicast of group communication) In the most general sense, collaboration is the core problem and service of Web applications, although collaboration usually refers to system with real-time synchronous and compelling time constraints

Next generation of Web client should enable pervasive accessibility


Ubiquitous availability to clients fro heterogeneous platforms (e.g. Windows, Linux, Unix, and PalmOS) Uniform Web interface that provides a platform with aggregation of multiple services

March 2, 2005

Xiaohong Qiu

Architecture of network system


PDA
IBM

Database

re

Sh a

tem Applications Gr Sys id c ile rk Web Service routi om F ng etwo n p


rl a

Supercomputer

Messaging Infrastructure
W A Network N ATM
switch

ut in

P) OA (S

P2 P

O ve

Core

FT P W SDL Stre a mi ng Media

router

t lne rd Te oa SSL eb hit Shared W


Laptop

Cellular phone

router

File Server

TC IP P 3 SM P UD 32 TP H ing HTT ls nc W re P Application protoco eb nfe Bro w se Co rs Multip A/V layer game

Workstation

March 2, 2005

Xiaohong Qiu

Desktop

Our approach
Explicit messaging replacing implicit messaging of traditional event listener paradigms

Key idea is to generalize MVC with model and view communicating by messages with the messaging providing control mechanism
Message-based MVC (M-MVC) paradigm integrates distributed, Web, and desktop applications SMMV and MMMV for general collaboration paradigms

Prototyping monolithic SVG collaborations


Shared SVG browser Share online chess game

Decomposed SVG experiments and detailed performance measurements to test viability of loose coupling services message-based Specifically investigate
M-MVC and MVC M-MVC and Web Applications (Services) M-MVC and collaboration (SMMV and MMMV paradigms) M-MVC and messaging infrastructure (NaradaBrokering middleware)

March 2, 2005

Xiaohong Qiu

Related Technologies
Batik SVG browser (an open source project from Apache that supports SVG 1.0)
A presentation style application is representative and complex in nature (we experiments with multiplayer-online game with high interactivity and compelling time constraints) Similar applications includes Microsoft PowerPoint, Adobe Illustrator, Macromedia Flash

SVG (W3C specifications for Scalable Vector Graphics)


A language for describing 2D vector and mixed vector/raster graphics in XML.

DOM (W3C specifications for Document Object Model)


Programmatic interfaces for access and manipulate structured document object All modern browsers (approximately) support the W3C DOM DOM event model specifies event semantics and how to register event handlers and describe event flow through a tree structure

March 2, 2005

Xiaohong Qiu

10

Model-View-Controller (MVC) model

Model Controller
Mouse event Keyboard events

View
Display

March 2, 2005

Xiaohong Qiu

11

Double-linked multiple-stage Web Services pipeline model of Web applications

Object Or WS

Object Or WS

Object Or WS

Object Or View

Object Or Display

March 2, 2005

Xiaohong Qiu

12

Architecture of Message-based MVC


M-MVC is a general approach for building applications with a message-based paradigm It emphasizes a universal modularized service model with messaging linkage

Converges desktop application, Web application, and Internet collaboration


MVC and Web Services are fundamental architectures for desktop and Web applications Web Service pipeline model provides the general collaboration architecture for distributed applications M-MVC is a uniform architecture integrating the above models

M-MVC allows automatic collaboration, which simplifies the architecture design


March 2, 2005 Xiaohong Qiu 13

Message-based MVC model

Model Web Service Sematic High Level UI

Input port Events as messages

Output port Rendering as messages

Raw UI Display User Interface View Messages contain control information

March 2, 2005

Xiaohong Qiu

14

A comparison of MVC and pipeline model in a case of SVG application


Model View Controller Decomposition of SVG Browser Semantic

Model
Events as messages Controller High Level UI Rendering as messages

View

Input port
Events as messages

Output port
Rendering as messages Raw UI Display

Display

Messages contain control information

a. MVC Model

b. Three-stage pipeline

Reformulation of SVG to message-based MVC in a Web Service Model March 2, 2005 Xiaohong Qiu 15

Monolithic SVG Experiments


Collaborative SVG Browser
Teacher-Students scenario Static Shared SVG contents Dynamic Share SVG contents Hyperlink
Interactivity and animation (JavaScript binding)

Collaborative SVG Chess game


Two players-multiple observers scenario Complex interactivity with game intelligence
March 2, 2005 Xiaohong Qiu 16

Collaborative SVG Chess Game


Players

March 2, 2005

Xiaohong Qiu

Observers

17

Making SVG collaborative by sharing of intercepted events via messaging broker with Publish/Subscribe scheme
Set up an event class (topic) Publish an event Facing

Broker
to collaborative clients

Subscribe to the topic Facing Facing

Model
Application as Web Service

Model
Application as Web Service JavaScript

JavaScript SVG DOM SVG DOM Facing Facing Output port Rendering as messages GVT Input port Event as messages GVT Input port Output port Rendering as messages

Renderer Renderer

View
Master client

View
Participating client

March 2, 2005

Xiaohong Qiu

18

Collaborative SVG Event processing chart


Collaborative events
(e.g. Master Events which has context information of collaboration and information from previous stages)

Raw UI events
(e.g. Mouse and key events)

High Level UI events


(e.g. SVG/DOM events)

Semantic events

(e.g. Application events such as capture in chess game)

Classes of Events in SVG Around 60 detailed Events

March 2, 2005

Xiaohong Qiu

19

Architecture of collaborative SVG browser on PC


Data to other clients F Control to/from XGSP R

Master client SVG browser 1


I O

Event (Message) Service Infrastructure

NaradaBrokering

XGSP Session control Server

Control to/from all SVG browsers in the collaborative session

Data from master client F Control to/from XGSP

Other client SVG browser 2


I O

Data from master client F Control to/from XGSP

Other client SVG browser n


I O

This is monolithic SVG example Shows potential use of XGSP from GlobalMMCS project to March 2,control collaborative applications 2005 Xiaohong Qiu

20

Architecture of multiplayer game with SVG


XGSP Session control Server Control to/from SVG WS1,2, , n

Event (Message) Service Infrastructure

SVG WS 1 Rendering to SVG display 2 SVG WS 2 Control to/from XGSP, SVG display 2

SVG display 1 Rendering from SVG WS 2 SVG display 2 Control to/from SVG display 2

NaradaBrokering

SVG WS n

Internet Game

SVG display n

Control to/from SVG WS1,2, , n

This is decomposed SVG example


March 2, 2005 Xiaohong Qiu 21

Decomposed SVG Experiments


Convert a standalone application into distributed system by splitting Model and View. Where to split? How to split? How difficult to split? Is performance acceptable?
March 2, 2005 Xiaohong Qiu 22

Three MVC approaches based on different communication mechanism and interactive pattern between model and view

Broker

Pub/Sub Control

View

Model

View

Messages

Model

View

Model

a) classic (method-based)

b) request/response (method-based or message-based)

c) publish/subscribe (message-based)

March 2, 2005

Xiaohong Qiu

23

Method-based MVC vs. message-based MVC


Broker

register call back method

A
invoke call back method with event

method based

message based

What we are doing when we move from classic MVC (monolithic model) to M-MVC (decomposed model)

March 2, 2005

Xiaohong Qiu

24

Decomposition of SVG browser into stages of pipeline


View Decomposition Point Model

GVT tree Output (Renderer) (update image buffer) (GraphicsNode changes )

DOM tree (after mutation)

SVG parser

JavaScript (access and manipulate DOM element)

GVT tree Input (UI events) (e.g. Mouse and key events) (GraphicsNode events)

DOM tree (before mutation) (DOM events)

We analyzed flow of events in Batik to see where best to decompose into Model and View. There was no clear separation in original code
March 2, 2005 Xiaohong Qiu 25

Important principals
One should split at points where the original method based linkage involved serializable Java objects.
Serialization is needed before the method arguments can be transported and this is familiar from Java RMI.

Spaghetti classes implied that additional state information would need to be transmitted if we split at points where classes spanned interfaces from different modules.
Batik often involved large classes that implemented many different interfaces. These interfaces often came from different parts of the program and crossed the possible stages mentioned above.

Message-based MVC paradigm tends to force a more restrictive programming model


All data are shared explicitly and not implicitly via interfaces crossing splitting lines.

March 2, 2005

Xiaohong Qiu

26

Implementation of Decomposed SVG Browser

batch processing rendering request

EventProcessor
Subscriber 2 GVT

JSVGCanvas
Subscriber 2

Rendering

client client

NB NB

NB event NB event

client client

NB NB

Subscriber 2 DOM

Subscriber 2 JavaScript

JSVGCanvas
Subscriber 2

Subscriber 2 GVT

Input
vector events/event compression

client client

NB NB

NB event NB event

client client

NB NB

Subscriber 2 DOM

EventProcessor

Figure 6.5 Decomposed SVG Browser in M-MVC paradigm

March 2, 2005

Xiaohong Qiu

27

Implicit State

Broker

Broker

A A
View

Shared state

Conventional shared state model

Separated component/service model

Implicit state needs to be serialized and integrated into the service model.

March 2, 2005

Xiaohong Qiu

28

The changes bring up issues that cause a challenge to the system


Timing becomes a compelling issue
With the separation of client and Web Service server, original assumption and design principle break The time scope drastically increases from tens of microsecond level (e.g. a Java method call) to a few milliseconds level (network latency plus system overhead).

Object serialization is a must have toolkit


Messages, as a linkage vehicle, contains component information from both sides and keep context same

Synchronization is a factor to consider for context consistency


March 2, 2005 Xiaohong Qiu 29

Performance and Analysis


Experiments with decomposed Batik SVG browser based on MMVC model. The decomposed Model and View interact with event-based message via messaging broker provided by NaradaBrokering.

Many variables are set for testing scenarios, which including


locations of Model, View and event broker runtime environment (e.g. OS and network connection)

Analysis
Relationship of user interactions and structure of mouse events Performance of fine-grained mouse events Factors (network latency and computation overhead, thread scheduling etc.) that affect overall system performance
March 2, 2005 Xiaohong Qiu 30

Definition of typical events of distributed applications


Applications Email Instant Messenger Shared File System (P2P) Distributed Simulation Internet TV Broadcast (Streaming Media) Video/Audio Conferencing Shared Browser Shared Whiteboard Multiplayer Online Game (e.g. chess) Parallel Computing MacroEvent writing an email writing one line of message downloading a file messaging passing (exchanging a message between components) one-way buffering multi-way buffering (interactivity) loading a new URL drawing a new graphics component (e.g. a rectangle, a line, a path) moving a piece updating a region held in a single node MicroEvent a key stroke a key stroke n/a n/a inter-frame delay inter-frame delay a mouse click on a hyperlink a mouse movement a mouse movement message passing (exchanging a message between components) 31

March 2, 2005

Xiaohong Qiu

Summary of typical distributed applications and characteristics


Content avg. min level of interactivity Macro Event min sec min sec sec Micro Event milli sec milli sec n/a n/a .033 sec bandwidth low low high high high network connectivity features latency tolerance level minutes or above second minutes or above 100s millisecs second reliabili ty no no yes yes no connectivit y type point-topoint multicast multicast point-topoint broadcast

Application

type

Rendering complexity low low n/a n/a high

Email Instant Messenger Shared File System (P2P) Distributed Simulation Internet TV/Broadcast

text, image text byte stream byte message image, sound

Video/Audio Conferencing
Shared Whiteboard Multiplayer Online Game

image, sound
text, image text, image, sound byte message

high
high high

sec
sec sec

.033 sec
milli sec milli sec > 10 microsec

high
low low

100s millisecs
10s millisecs 10s millisecs 10 microsecs

no
yes yes

multicast
multicast multicast

Parallel Computing March 2, 2005

n/a

large

high

yes

point-topoint

Xiaohong Qiu

32

Performance Testing and timing points


View (Client)
Notification service (NaradaBrokering)

Model (Service)

T4

Output
(Rendering)

GVT tree

T3 DOM tree T2
(mirrored)

Event Processor

T1

Event Processor

DOM tree (after mutation)


JavaScript

Broker
Input (UI events) GVT tree DOM tree (mirrored)

T0 Event Processor

T0

Event Processor

DOM tree (before mutation)

Machine A

Machine B

Machine C

T0: A given user event such as a mouse click that is sent from View to Model. T1: A given user event such as a mouse click can generate multiple associated DOM change events transmitted from the Model to the View. T1 is the arrival time at the View of the first of these.

T2: This is the arrival of the last of these events from the Model and the start of the processing of the set of events in the GVT tree
T3: This is the start of the rendering stage T4: This is the end of the rendering stage March 2, 2005 Xiaohong Qiu 33

Average Performance of Mouse Events


Mousedown events
Test Test scenarios First return Send time: T1-T0 (milliseconds) mean error Stdd ev 14.8

Average of all mouse events (mousedown, mousemove, and mouseup)


First return Send time: T1-T0 (milliseconds) mean error 37.9 2.1 18.9 0.89 stdde v 18.7 Last return Send time: T1T0 (milliseconds) mean error 48.9 2.7 31.0 1.7 stdd ev 23.7 End Rendering T4-T0 (microseconds) mean error stddev 173.0

No 1

distance Switch connects Switch connects

NB location Desktop server Highend Desktop server Linux server Linux cluster node server Solaris server Solaris server

33.6 3.0 18.0 0.57 14.9 0.65 20.0 1.1 17.0 0.91 20.0 1.3

294.0 20.0 123.0 8.9 414.0 24.0 334.0 22.0 404.0 20.0 337.0 22.0

2.8

9.07

17.6

91.2

Office area WithinCity (Campus area) Inter-City

2.8

21.0 1.3 29.7 1.5

10.2

43.9 2.6 49.5 3.0

20.5

185.0

4.8

13.6

26.3

194.0

4.3

24.8 1.6 29.6 1.7

12.8

48.4 3.0 50.5 3.4

23.3

160.0

Inter-City

6.4

15.3

26.0

189.0 34

Immediate bouncing back event


Bouncing back event
Test Test scenarios Bounce back Send time: (milliseconds) mean error Stdde v 19.0

Average of all mouse events (mousedown, mousemove, and mouseup)


First return Send time: T1-T0 (milliseconds) mean error 52.1 2.8 29.5 1.5 36.3 1.9 26.9 1.6 31.8 2.2 37.8 2.7 stdd ev 19.4 Last return Send time: T1T0 (milliseconds) mean error 68.0 3.7 49.5 3.1 54.2 2.9 46.7 2.9 54.6 4.9 55.6 3.4 stdd ev 25.9 End Rendering T4-T0 (milliseconds) mean error stddev 159.0

No 1

distance Switch connects Switch connects Office area

NB location Desktop server High-end Desktop server Linux server Linux cluster node server Solaris server Solaris server

36.8 2.7 20.6 1.3 24.3 1.5 15.4 1.1

405.0 23.0 158.0 12.0 364.0 22.0 329.0 25.0

12.3

13.8

29.4

109.0

11.0

14.2

21.9

166.0

Within-City (Campus area) Inter-City

7.6

11.6

20.6

179.0

18.1 1.3
21.7 1.4

8.8

14.5

32.8

351.0 27.0
364.0 25.0

179.0

Inter-City

9.8

19.3

23.6

176.0 35

Basic NB performance in 2 hops and 4 hops


2 hops (View Broker View) milliseconds No 1 mean error 7.65 0.61 stddev 3.78 4 hops (View Broker Model Broker View) milliseconds mean error 13.4 0.98 stddev 6.07

Test

2
3 4 5 6

4.46 0.41
9.16 0.60 7.89 0.61 7.96 0.60 7.96 0.60

2.53
3.69 3.76 3.68 3.67

11.4 0.66
16.9 0.79 14.1 1.1 14.0 0.74 16.8 0.72

4.09
4.85 6.95 4.54 4.47

March 2, 2005

Xiaohong Qiu

36

Observations I
This client to server and back transit time is only 20% of the total processing time in the local examples. The overhead of the Web service decomposition is not directly measured in tests shown these tables The changes in T1-T0 in each row reflect the different network transit times as we move the server from local to organization locations. This overhead of NaradaBrokering itself is 5-15 milliseconds depending on the operating mode of the Broker in simple stand-alone measurements. It consists forming message objects, serialization and network transit time with four hops (client to broker, broker to server, server to broker, broker to client). The contribution of NaradaBrokering to T1-T0 is about 30 milliseconds in preliminary measurements due to the extra thread scheduling inside the operating system and interfacing with complex SVG application. We expect the main impact to be the algorithmic effect of breaking the code into two, the network and broker overhead, thread scheduling from OS.
March 2, 2005 Xiaohong Qiu 37

Comparison of performance results to highlight the importance of the client


16 5

Events per ms bin

Message transit time in M-MVC Batik browser mousedown All Events event mouseup event mousemove event Mousedown Mouseup Mousemove all events

Events per 40 5 ms bin


35

Message transit time in M-MVC Batik browser

14

number of events in 5 millisecond bins

12

30

All Events Mousedown Mouseup Mousemove

all events mousedown event mouseup event mousemove event

10

25

20

15

Configuration:
10

NB on View ; Model and View on tw o desktop PCs; local sw itch netw ork connection; NB version 0.97; TCP blocking protocol; normal thread priority for NB; JMS interface; no echo of messages from Model;

10

20

30

40 50 60 minimum T1-T0 in milliseconds

70

80

90

100

10

20

30

40 50 60 minimum T1-T0 in milliseconds

70

80

90

100

Time T1-T0 milliseconds


NB on View; Model and View on two desktop PCs with high-end graphics Dell (3 Ghz Pentium) for View; 1.5 Ghz Dell for Xiaohong Qiu model; local switch network 38 connection.

NB on Model; Model and View on two desktop 1.5 Ghz PCs; local switch network connection.
March 2, 2005

Comparison of performance results with Local and remote NB locations


20 5 18 16 14 12 10 8 6 4 2 0
0

Events per ms bin

Message transit time in M-MVC Batik browser

number of events in 5 millisecond bins

All Events Mousedown Mouseup Mousemove

all events mousedown event mouseup event mousemove event

Events per 15 5 ms bin

Message transit time in M-MVC Batik browser

10

All Events event mousedown mouseup event mousemove event Mousedown Mouseup Mousemove

all events

Configuration:

NB on View ;netw ork connection;tw o d local sw itch Model and View on NB version 0.97; TCP for NB; protocol normal thread priority blocking JMS interface; no echo of messages fr

10

20

30

Time T1-T0 milliseconds NB on 8-processor Solaris server NB on local 2-processor Linux ripvanwinkle; Model and View on server; Model and View on two 1.5 two 1.5 Ghz desktop PCs; remote Ghz desktop PCs; local switch network connection through routers. network 2005 March 2, connection. Xiaohong Qiu 39

40 50 60 minimum T1-T0 in milliseconds

70

80

90

100

10

20

30

40 50 60 minimum T1-T0 in milliseconds

70

80

90

100

Observations II
One usually gets better performance moving the NaradaBrokering broker off the desktops; the better broker performance (there are no scheduling overheads) outweighs the increasing network overhead. The performance of NB on desktop server is not as good as that in fig 7.5 with NB on gridfarm1 machine running Linux server. The results in fig. 7.7 (ripvanwinkle with 100 miles round trip distance) generates similar pattern as in fig. 7.5 (local connection) except with a slightly lower performance corresponding to the greater network delay for ripvanwinkle.

Our results show that use of windows desktops to run NaradaBrokering is never good even when one uses a machine running the model and view with no network delay.
Windows scheduling introduces delays of 10-20 millisecond overhead that is much larger than the 1-2 millisecond delays coming from network transit within the extended university campus and the similar intrinsic processing time needed by NaradaBrokering on a clean Linux/UNIX machine. We have not looked at a Windows server (which has a different scheduling algorithm from desktop Windows) for NaradaBrokering; this could be better than the desktop Windows used in tests.
March 2, 2005 Xiaohong Qiu 40

Message transit time in M-MVC Batik browser 20 18 16


number of events in 5 millisecond bins

all events mousedown event mouseup event mousemove event

14 12 10 8 6 4 2 0

This illustrates that this type of HPC engine can be used in Web Server mode with each node running different services. We are only using one node and so this is not a parallel computing application

10

20

30

40 50 60 minimum T1-T0 in milliseconds

70

80

90

100

NB on one node of HPC Linux cluster; Model and View on two desktop PCs; routers network 2, 2005 March connection. A few events with timing greater than 100 milliseconds are not Xiaohong Qiu 41 shown on the plot

Comparison of performance results on 2 remote NB locations


Events per 5 30 ms bin
Message transit time in M-MVC Batik browser

Events per 15 5 ms bin


all events mousedown event mouseup event mousemove event

Message transit time in M-MVC Batik browser

25

number of events in 5 millisecond bins

20

All Events Mousedown Mouseup Mousemove

10

All Events event mousedown mouseup event mousemove event Mousedown Mouseup Mousemove

all events

15

10

Configuration: and View on tw o de NB on View ;netw ork connection; local sw itch Model

NB version 0.97; TCP for NB; protocol; normal thread priority blocking JMS interface; no echo of messages fro

10

20

30

40 50 60 minimum T1-T0 in milliseconds

70

80

90

100

10

20

30

Time T1-T0 milliseconds

40 50 60 minimum T1-T0 in milliseconds

70

80

90

100

NB on 8-processor Solaris server complexity; Model and View on two desktop PCs; remote network March 2, 2005 connection through routers.

NB on 8-processor Solaris server ripvanwinkle; Model and View on two desktop PCs; remote network Xiaohong Qiu 42 connection through routers.

Distribution of the mean of mouseup events


4 NB on Model NB on View NB on ripvanwrinkle

Distribution of the mean of mousemove events


6 NB on Model NB on View NB on ripvanwrinkle 5

3.5

number of events in 0.5 millisecond bins

Mean Mouseup

Mean Mousemove
4

2.5

1.5

1
0.5

0 36

38

40

42

44

46 milliseconds 8

48

50

52

54

56

Distribution of the mean of mousedown events

0 15

20 milliseconds

25

30

Events Per 0.5 ms


number of events in 0.5 millisecond bins

NB on Model NB on View NB on ripvanwrinkle

Mean Mousedown

NB on Ripvanwinkle NB on View NB on Model 15 runs each split over 3 days

Mean ms
March 2, 2005

Xiaohong Qiu

43

Distribution of the standard deviation of mouseup events


4 NB on Model Standard Deviation NB on View NB on ripvanwrinkle Mouseup
number of events in 0.5 millisecond bins
7

Distribution of the standard deviation of mousemove events


NB on View Standard Deviation NB on ripvanwrinkle Mousemove NB on Model

3.5

2.5

1.5

0.5

10

11

12

13 milliseconds
6

14

15

16

17

18

10 12 milliseconds

14

16

18

Distribution of the standard deviation of mousedown events

Events Per 0.5 ms


number of events in 0.5 millisecond bins

Standard Deviation Mousedown

NB on Model NB on View NB on ripvanwrinkle

NB on Ripvanwinkle NB on View NB on Model 15 runs each split over 3 days

Mean ms
March 2, 2005

Xiaohong Qiu
0 2 4 6 8 10 12 14

44

Observations III
Ripvanwinkle ALWAYS Better Means and Standard Deviations do not vary much from run to run Mouse Down has larger standard deviation when NB on Model Note Mouse Down has least model processing NB-Model and NB-View similar except for Mouse Down where NB-View better In an exploratory run with NB running over the local network on a Dell PC with Window XP (heavy loaded), we found very poor performance. For example, the mean of the mousedown event was 92 milliseconds compared to 16 milliseconds on ripvanwinkle

March 2, 2005

Xiaohong Qiu

45

Summary of message-based MVC


Provision of a universal paradigm with a service model converging desktop applications, Web applications, and Internet collaboration Web applications built on messages can achieve important features such as scalability The message-based approach is an indispensable part of the big picture of system design with a separate intermediate messaging layer
Reduce deployment overhead of applications Increase portability of application by decoupling application architecture with underlying platforms

It conforms to service oriented architecture with loosely coupled messages linkage, which we expect to have an increasingly important role for reusability, interoperability, and scalability
March 2, 2005 Xiaohong Qiu 46

SMMV vs. MMMV as MVC interactive patterns


Model 1 Model 2 Model m-1 Model m

Model

View 1

View 2

View n-1

View n

View 1

View 2

View n-1

View n

a) Single Model Multiple View

b) Multiple Model Multiple View

SIMD A single control unit dispatches instructions to each processing unit. MIMD Each processor is capable of executing a different program independent of the other processors. It enables asynchronous processing. SMMV generalizes the concept of SIMD MMMV generalizes the concept of MIMD In practice, SMMV and MMMV patterns can be applied in both asynchronous and synchronous applications, thus form general collaboration paradigms. March 2, 2005 Xiaohong Qiu 47

Collaboration Paradigms
Monolithic Collaboration
All participating components are formed as replications of an existing application without explicit break up into a separate Model and View component as required by the Web service architecture. Works through interception of the events on a master application and allows messaging broker to multicast them to the collaborating clients.
CGL applications of PowerPoint, OpenOffice and data visualization

Web Service Collaboration framework


Shared input port replicated Web Service
CGL applications including A/V conferencing, shared whiteboard, text chats and SVG chess

Shared output port


CGL shared display application

SMMV and MMMV collaboration model (integration of desktop and distributed models)
SMMV decomposed Model and View with multiple clients sharing a single Model component.
Instructor led learning

MMMV decomposed Model and View with multiple models each driving its own separate View. It enables ubiquity with the customization done from the Model at server side.
Participatory learning

March 2, 2005

Xiaohong Qiu

48

Monolithic collaboration
NaradaBrokering

SVG browser master client

SVG browser other master client

SVG browser other master client

SVG browser other master client

Identical programs receiving identical events

Collaboration paradigms deployed with M-MVC model


NaradaBrokering

Model
as Web Service Model as WS NaradaBrokering Broker Broker Broker Broker Model as WS Model as WS Model as WS

View
master client

View
other client

View
other client

View
other client

View
master client

View
other client

View
other client

View
other client

March 2, 2005

SMMV

MMMV
Xiaohong Qiu 49

Summary of Contributions
Proposing an explicit Message-based MVC paradigm (MMVC) as the general architecture of Web applications Demonstrating an approach of building collaboration as a Web service through monolithic SVG experiments.
As an example, we present architecture for three types of collaboration monolithic, thin client, and interactive client.

Bridging the gap between desktop and Web application by leveraging the existing desktop application with a Web service interface through MMVC in a publish/subscribe scheme.
As an experiment, we convert a desktop application into a distributed system by modifying the architecture from method-based MVC into message-based MVC.

Proposing Multiple Model Multiple View and Single Model Multiple View collaboration as the general architecture of collaboration as a Web service model. Identifying some of the key factors that influence the performance of messagebased Web applications especially those with rich Web content and high client interactivity and complex rendering issues.
March 2, 2005 Xiaohong Qiu 50

Questions Answered
Can MVC be implemented in a message-based fashion? What principles are there to govern the decomposition of a given application into M-MVC components? What is the performance of the message-based MVC and what factors influence it? How does M-MVC depend on the operating system, the application, machines and network? What is the relationship of collaboration and Web services with M-MVC paradigm? What is the way to define state and state changes in collaborative applications? How easy is it to convert an existing application to message-based MVC? What are the architectural and implementation principles to be used in building applications from scratch in a message-based MVC paradigm?
March 2, 2005 Xiaohong Qiu 51

Future Work
Analyze performance in other cases (Linux clients, Windows servers) Optimize Performance with closer integration with NaradaBrokering and cleaner data structures What is best publish-subscribe architecture for M-MVC? Apply M-MVC to other applications (e.g. OpenOffice) Use of Web Service specifications (WSRP, WS- Management) to define M-MVC Use of XGSP in Collaborative SMMV and MMMV
March 2, 2005 Xiaohong Qiu 52

Reference
Thesis for download http://grids.ucs.indiana.edu/~xqiu/dissertation.html Thesis project http://grids.ucs.indiana.edu/~xqiu/research.html Publications and Presentations http://grids.ucs.indiana.edu/~xqiu/publication.html NaradaBrokering Open Source Messaging System http://www.naradabrokering.org Information about Community Grids Lab project and publications http://grids.ucs.indiana.edu/ptliupages/

March 2, 2005

Xiaohong Qiu

53