hw2 introduction csci-578 fall 2012. 2 event-based style independent components asynchronously emit...

29
HW2 INTRODUCTION CSCI-578 Fall 2012

Upload: kelly-sutton

Post on 23-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

HW2 INTRODUCTION

CSCI-578 Fall 2012

2

Event-Based Style

Independent components asynchronously emit and receive events communicated over event buses

Components: Independent, concurrent event generators and/or consumers

Connectors: Event buses (at least one) Data Elements: Events – data sent as a first-class entity over

the event bus Topology: Components communicate with the event buses, not

directly to each other. Variants: Component communication with the event bus may

either be push or pull based. Highly scalable, easy to evolve, effective for highly distributed

applications.

3

Event-based LL

Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

DEB Systems

Typically based on message-oriented middleware (MOM)

Components via implicit invocation Producers and consumers Message interfaces

Message sink Message source

Message Types

Nominal Mapped to statically checkable PL types

Subject-Based “/Weather/Germany/Berlin”

Attribute-Based Key-Value Pairs

Attribute-based Messages

Key-value pairs Key: Name, Value: PicUpdate Key: Sum, Value: 50

Attribute Reading Attribute Adding or Modifying

What Makes It Hard?

Ambiguous Interfaces State-based dependencies

void onMessage(Message msg) { String type = msg.getJMSType();

if (type.equals( “On/Off”) ) { ... } else if (type.equals(“PicRequest”))

{ ... }}

Message

Dispatch

Inter-Component Message Dependence

Classifying Message Dependences

Classifying Message Dependences

Inter-Component Message Dependence

Intra-Component Dependence Control-Flow-Based

Inter-Component Message Dependence

Intra-Component Dependence Control-Flow-Based Data-Flow-Based

Classifying Message Dependences

HW2

Maintenance Tasks Description of changes

Message-based dependencies Why

Some tools The applications and MOM platforms

STOX in general

Monitoring Stock changes and alerting coustomers Three Important part:

Trigger List Absolute limit:

Triggered if the price of the respective stock is either below or above a specified range

Relative limit: Triggered if the price of a given stock has increased or decreased a

given number of percentages within a given time interval.

Portfolio depicts detailed information about the stocks that a user

currently holds Charts

visualize the price of a certain stock over time

STOX Architecture

Use of Regular Expressions

AbsLimitEvent*

Use of Regular Expressions(Cont.) publish(.*AbsLimitEvent.*)

16

KLAX

Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

17KLAX in C2

Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

18

C2 Style

An indirect invocation style in which independent components communicate exclusively through message routing connectors. Strict rules on connections between components and connectors induce layering.

19

C2 Style (cont’d)

Components: Independent, potentially concurrent message generators and/or consumers

Connectors: Message routers that may filter, translate, and broadcast messages of two kinds: notifications and requests.

Data Elements: Messages – data sent as first-class entities over the connectors. Notification messages announce changes of state. Request messages request performance of an action.

Topology: Layers of components and connectors, with a defined “top” and “bottom”, wherein notifications flow downwards and requests upwards.

c2.fw framework

MOM platform that KLAX is built from Enforces C2 Style

Includes C2 components C2 connectors Messages

SPECjms2009

JMS-based MOM TextMessages, ObjectMessages,

StreamMessages or MapMessages Pub/sub (topics) vs. P2P messages (queues)

Performance benchmarks Supply chain of a supermarket company Documentation provided Message types

The Supply Chain Simulation

Unix Commands

find Finds files and directories

xargs Reads from standard input Builds arguments Calls command

grep Regular expressions

Example

joshua@triagia:~/workspace/Stoxx-Hyperion$ find src/ -iname "*.java" | xargs grep -i publish\(src/Events/RemoteEventBroker.java:         publish(new CloseConnectionEvent());src/Events/Component.java: void publish(Event e);src/Events/EventBroker.java: public void publish(Event e);src/Events/SimpleComponent.java:    publish(e);src/Events/DefaultScope.java:    public void publish(Event e) {

25

Implicit Invocation Style

Event announcement instead of method invocation “Listeners” register interest in and associate

methods with events System invokes all registered methods implicitly

Component interfaces are methods and events Two types of connectors

Invocation is either explicit or implicit in response to events

Style invariants “Announcers” are unaware of their events’ effects No assumption about processing in response to

events

26

Implicit Invocation (cont’d)

Advantages Component reuse System evolution

Both at system construction-time & run-time Disadvantages

Counter-intuitive system structure Components relinquish computation control

to the system No knowledge of what components will

respond to event No knowledge of order of responses

27

Publish-Subscribe

Subscribers register/deregister to receive specific messages or specific content. Publishers broadcast messages to subscribers either synchronously or asynchronously.

28

Publish-Subscribe (cont’d)

Components: Publishers, subscribers, proxies for managing distribution

Connectors: Typically a network protocol is required. Content-based subscription requires sophisticated connectors.

Data Elements: Subscriptions, notifications, published information

Topology: Subscribers connect to publishers either directly or may receive notifications via a network protocol from intermediaries

Qualities yielded: Highly efficient one-way dissemination of information with very low-coupling of components

29

Pub-Sub LL

Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.