![Page 1: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/1.jpg)
A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems
CS 5381Steven Ruiz
Authors: Sam Malek, Marija Mikic-Rakic, and Nenad Medvidovic
![Page 2: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/2.jpg)
Table of Contents
Introduction Objectives Middleware Design Prism Setting Support Architectural Support Evaluation
![Page 3: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/3.jpg)
Introduction Software Systems are increasingly
moving from desktop to the mobile setting
Programming in the small and many (Prism) Properties: Highly Constrained Resources
Limited power Low network bandwidth Slow CPU speed, limited memory Small display size
![Page 4: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/4.jpg)
PrismMW Programming in the Large (PitL)
Suited mainly for desktops Middleware
Developed to support the implementation of Software Arch. in Prism setting
Provides architecture level concepts Component Connector Configuration Events
![Page 5: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/5.jpg)
Key Contributions Employs a separation of concern Provides:
Flexibility Efficiency
Size, speed, overhead Scalability
Number of components, connectors, events, threads, hardware devices
Extensibility Support for new development concerns
![Page 6: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/6.jpg)
Prism Goals Investigate the following issues:
Mobile device limits (power, size, memory, ..)
Modeling Analysis Simulation
Prism characterized by Proprietary OS’s (Palm, Symbian)
Tie in Prism with Software architecture (architecture-based development)
![Page 7: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/7.jpg)
Objectives (Support)
Provide native support for designing & implementing architectural abstraction
Should accommodate system development based on different styles
Address the main parts of arch. based design/implementation and middleware
![Page 8: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/8.jpg)
Objectives (Small & Many) Enable efficient execution of apps on
platforms with different characteristics Extend support for access of shared
hardware Scalable
Large set of devices Execution Threads Components, connectors, communication
Extensible & Configurable Accommodate varying development concerns Multiple Arch. Styles
![Page 9: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/9.jpg)
Example Application TDS (Troops Deployment &
Simulation) Distributed deployment of
personnel Headquarters
Gathers info from field & displays current battlefield status
Networked via secure links to PDA’s
Commanders Connected to soldiers Give orders to soldiers
Soldiers View segment of battlefield
& receive orders
![Page 10: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/10.jpg)
TDS Components Map
Model of system resources (terrains, tanks,..) Repository
Stores map resources StrategyAnalyzerAgent
Analyze deployment of friendly troops DeploymentAdvisor
Suggests deployments of troops SimulationAgent
Simulates outcomes
![Page 11: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/11.jpg)
Prism Core 12 classes, 4 interfaces Limited direct dependencies Brick Class
Abstract class representing architectural building blocks Scaffold Class (associated with every Brick)
Schedules and queues events for delivery Pools execution threads used for event dispatching Allows most suitable event scheduling
Architecture Class Records the configuration of its constituent components,
connectors, ports, and provides removal capability Event
Captures communication in an architecture
![Page 12: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/12.jpg)
Prism Core (UML)
![Page 13: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/13.jpg)
Prism Core (Cont) Ports
Link made by welding 2 ports together Port can be welded to another corresponding
port Associated Types
Request Reply
Events placed on a port are forwarded to its linked port
Request events: forwarded from request to reply ports
Reply events: forwarded in opposite direction
![Page 14: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/14.jpg)
Prism Core (Ports)
![Page 15: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/15.jpg)
Prism Core (Components) Component
Performs computations in an architecture and maintains its own state
Each component has an arbitrary number of attached ports
Interact with each other by exchanging events via ports
Interacts either directly through ports or via connectors
![Page 16: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/16.jpg)
Prism Core (Connectors)
Connectors Central routing of events Has arbitrary number of attached ports Component attaches to a connector by
creating a link between one of its ports Components/Connectors can remove
and add ports at runtime
![Page 17: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/17.jpg)
Prism Core (Interfaces)
Interface Each subclass of brick has an associated
interface IComponent – send and handle methods IArchitecture – weld method attaches 2 ports IConnector – handle method for routing
events IPort – provides setMutualPort method for
creating one-one association between 2 ports
![Page 18: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/18.jpg)
Prism Semantics Event processing performed through
Shepherd thread Shepherd thread removes the event
from head of queue If component generates further events,
it is added to end of queue Benefits
Event routing to multiple destinations reduces power consumption
![Page 19: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/19.jpg)
PrismMW Design Extensibility
Core constructs are subclassed via specialized classes
Each AbstractExtension class can have multiple implementations
![Page 20: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/20.jpg)
Support for Prism Setting Distribution
5 different port extensions are implemented DistributionEnabledPort
Operates in server mode (has listening thread) Has arbitrary number of network connections Broadcasts events on all network connections One-to-many association between ports
Varies from the basic port (one-to-one) Deposits events on the network instead of local
event queue
![Page 21: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/21.jpg)
Distribution Scenarios
![Page 22: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/22.jpg)
Support for Prism Setting (cont.) Communication Properties
Security AbstractSecurity – port extension providing RSA and
authentication services Delivery Guarantees
AbstractDeliveryGuarantees AbstractDeliveryGuaranteesEvt
Support event delivery guarantees Real-Time Delivery
AbstractRealTimeEvt Assigns a real time deadline to an event
Data Conversion and Compression AbstractXMLConversion – Encoding/Decoding via ports AbstractCompression – minimizes network bandwidth for event
dispatching
![Page 23: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/23.jpg)
Support for Prism Setting (cont.)
Awareness ExtensibleComponent
Contains references to the architecture object via IArchitecture interface
Observes components at the metalevel to facilitate different aspects of execution of application-level components
Developer can add metalevel components to a running application
![Page 24: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/24.jpg)
Support Prism Setting (cont.) Deployment and Mobility
Configuration of components deployed onto a set of connected hosts
Stateless Mobility/Deployment ExtensibleEvents – contains architectural elements AdminComponent – contains a pointer to its architecture object,
which allows runtime changes to its local subsystem’s architecture:
Addition, removal, connection, disconnection of components and connectors
Stateful Mobility Provides the ability to transfer code between a set of hosts Serialization-based technique – Forwarding of an element’s state
Disconnected Operation Ability to continue functioning in the temporary absence of
network connectivity
![Page 25: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/25.jpg)
Architectural Style Support
Support provided by Prism: Distinguish among different arch styles Specify the arch. Elements’ stylistic
behaviors Specify rules and constraints Use Multiple architectural styles within an
application
![Page 26: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/26.jpg)
Support for Individual/Multiple Styles Individual Styles
Supported through an Extensible class Simplified by using StyleFactory utility class Example: Client and Server Style
Multiple Styles Supported through hierarchical composition ExtensibleArchitecture used to create
components with their own internal archs.
![Page 27: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/27.jpg)
Evaluation Goals
Provide results of the performance trade-offs Demonstrate the middleware’s efficiency and
scalability in large distributed systems Middleware Size
Basic Logic System Memory Core: 2.3 KB Connection Object: 8 KB Port: 8.5 KB
TDS Architecture 1 Headquarters, 4 commanders, 100 soldiers Total memory overhead: 511 KB
![Page 28: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/28.jpg)
Evaluation
Benchmark Results
![Page 29: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/29.jpg)
Evaluation
Distributed Architecture Scenario Only 2 percent in performance
overhead compared to a “pure” java implementation
![Page 30: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/30.jpg)
Group Work
Client and Server Style Create a basic ClientServer representation using the
below topology( refer to (d) of diagram): One Server, Two Clients
![Page 31: A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad](https://reader030.vdocuments.us/reader030/viewer/2022032606/56649eb65503460f94bc078a/html5/thumbnails/31.jpg)
Group Work Use StyleFactory to match style for your Extensible [Architecture,
Component] StyleFactory methods below are static Below is the format to follow(Java based):
Class ClientServer { static public void main(String argv[]) { //Create your architecture first (use ExtensibleArchitecture)
//Each Extensible Component should have an implementation to describe it (3 in total, clients and server)
//Add your components to the architecture (3 components to add)
//Establish / Weld the connections between the clients -> server
//Start the architecture architecture.start();}
}