27
HW2 INTRODUCTION CSCI-578 Spring 2013

HW2 INTRODUCTION CSCI-578 Spring 2013. 2 Implicit Invocation Indirectly or implicitly calls to methods and interfaces in response to an event or a received

Embed Size (px)

Citation preview

HW2 INTRODUCTION

CSCI-578 Spring 2013

2

Implicit Invocation

Indirectly or implicitly calls to methods and interfaces in response to an event or a received message

Publish/Subscribe Event-based

3

Publish/Subscribe

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

4

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.

5

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.

6

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

The applications and MOM platforms Some tools

STOX in general

Monitoring Stock changes and alerting customers 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

17

KLAX

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

18KLAX 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.

19

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.

20

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

The Supply Chain Simulation

Use of Regular Expressions

AbsLimitEvent*

Use of Regular Expressions(Cont.)

publish(.*AbsLimitEvent.*)

Unix Commands

find Finds files and directories

xargs Reads from standard input Builds arguments Calls command

grep Regular expressions

Example