You are on page 1of 11

ADL Examples

ADL Roles
s

Provide models, notations, and tools to describe components and their interactions Support for large-scale, high-level designs Support for principled selection and application of architectural paradigms Support for abstractions
t t

user-dened application-specic

Support for implementing designs


t t

systematic possibly automated

Close interplay between language and environment


t t

language enables precise specications environment makes them (re)usable


February 25, 1999

CS 612: Software Architectures

ADL Examples

An Example ADL Description


s

An ACME architecture

Client

RPC

Server

System simple_cs = { Component client = {Port send-request} Component server = {Port receive-request} Connector rpc = {Roles {caller, callee}} Attachments : { client.send-request to rpc.caller; server.receive-request to rpc.callee } }

CS 612: Software Architectures

February 25, 1999

ADL Examples

ADL Denition
s

ADL Denition
t

An ADL is a language that provides features for modeling a software systems conceptual architecture. components
t

Essential features: explicit specication of


t

interfaces

t t s

connectors congurations specic aspects of components, connectors, and congurations tool support

Desirable features
t

CS 612: Software Architectures

February 25, 1999

ADL Examples

Differentiating ADLs
s

Approaches to modeling congurations


t t t

implicit conguration in-line conguration explicit conguration

Approaches to associating architecture with implementation


t t

implementation constraining implementation independent high-level design notations module interconnection languages (MIL) object-oriented notations programming languages formal specication languages
February 25, 1999

Related Notations
t t t t t

CS 612: Software Architectures

ADL Examples

Example ADL Wright


s s

Developed at CMU An architecture (system) consists of


t

component type specications


t t

a set of ports specication of component behavior (comp spec) a set of roles specication of role coordination (glue)

connector type specications


t t

t t s

instances of types attachments among instances

All specications are CSP protocols Used for detecting deadlocks in an architecture

CS 612: Software Architectures

February 25, 1999

ADL Examples

Example ADL UniCon


s s

Developed at CMU Universal Connector language Predenes supported component and connector types
t t

component types: module, computation, lter, process, ... connector types: pipe, le IO, procedure call, data access, remote proc call, ...
implementation constraining

Generates glue code for interconnecting components


t

Allows specication of non-functional properties

CS 612: Software Architectures

February 25, 1999

ADL Examples

UniCon syntax
s

An architecture is a composite component consisting of


t

atomic or composite component types consisting of


t

interface
t t

predened set of players and attributes predened set of attributes for each player

t t

implementation protocol
t t

connector types
t

predened set of roles and attributes predened set of attributes for each role

t t t

implementation

their instantiations (uses) their congurations (connect)


February 25, 1999

CS 612: Software Architectures

ADL Examples

UniCon Component Player


PLAYER input IS StreamIn MAXASSOCS (1) MINASSOCS (1) SIGNATURE (line) PORTBINDING (stdin) END input

UniCon Connector Role Constraint


ROLE output IS Source MAXCONNS (1) ACCEPT (Filter.StreamIn) END input

CS 612: Software Architectures

February 25, 1999

ADL Examples

UniCon Conguration
USES p1 PROTOCOL Unix-pipe USES sorter INTERFACE Sort-lter CONNECT sorter.output TO p1.source USES p2 PROTOCOL Unix-pipe USES printer INTERFACE Print-lter CONNECT sorter.input TO p2.sink

CS 612: Software Architectures

February 25, 1999

ADL Examples

10

Example ADL Rapide


s s

Developed at Stanford Focuses on modeling and simulation of dynamic behavior described by an architecture
t t t

partially ordered event sets (posets) poset-based constraints event patterns to recognize posets types constraint pattern architecture executable

Large language with several sublanguages


t t t t t

CS 612: Software Architectures

February 25, 1999

ADL Examples

11

Rapide Event Pattern Operations


s s

Dependent Both Distinct Either Independent After Iteration Guarded pattern useful in specifying dynamic recongurations

CS 612: Software Architectures

February 25, 1999

ADL Examples

12

Rapide Syntax
s

An architecture consists of
t

component types (interfaces)


t

synchronous communication interface elements functions


t t

provides requires

asynchronous communication interface elements events


t t

in action out action

t t

connectors (connections) constraints

CS 612: Software Architectures

February 25, 1999

ADL Examples

13

Rapide Event Patterns


Evt1(?prm) and Evt2(?prm); Evt1 Evt2; Evt1 < Evt2; Evt1(?prm) where ?prm < 0;

Rapide Component
type Application is interface in action Request(p : params); out action Results(p : params); behavior (?M in String) Receive(?M) => Results(?M);; end Application;

CS 612: Software Architectures

February 25, 1999

ADL Examples

14

Example ADL C2SADEL


s s

Developed at UC Irvine Balances formality and simplicity


t t

small number of language constructs semantics described in rst-order logic does not include descriptions of requests/notications separates provided from required component services separates interface from operations

Describes C2 components internal objects


t t t

CS 612: Software Architectures

February 25, 1999

ADL Examples

15

C2SADEL
s

Syntax

An architecture consists of
t

component types
t t t t t

subtype specications state variables invariant interface


behavior (operations)
t t t

local variables

preconditions postconditions

map from interface to behavior

CS 612: Software Architectures

February 25, 1999

ADL Examples

16

C2SADEL
t

Syntax (cont.)

connector types
t

message ltering policy


t t t t t

no ltering notication ltering message ltering prioritized message sink

their congurations (architectural topology)


t t t

component instances connector instances


their interconnections

CS 612: Software Architectures

February 25, 1999

ADL Examples

17

Variables and Basic Types


s

Variable declarations are similar to PLs


t

capacity : Integer; well_at : Integer -> Color;

Variables can also be declared as functions


t

C2SADEL
t

only supports declaration of basic types

no support for basic type semantics useful for component evolution


Natural is basic_subtype Integer;

Subtyping relationships among basic types are allowed


t t

CS 612: Software Architectures

February 25, 1999

ADL Examples

18

Component Evolution
s

Evolution is supported via subtyping


t

subtyping relationships as regions in the space of types


U nam int imp beh

component WellADT is subtype Matrix (beh) component WellADT is subtype Matrix (beh \and \not int)
CS 612: Software Architectures February 25, 1999

ADL Examples

19

Preconditions, Postconditions, and Invariants


s s

First-order logic formulas Invariants apply to entire components


t

must be expressed in terms of component state variables only


invariant { (num_tiles \eqgreater 0) \and (num_tiles \eqless capacity); }

Pre- and postconditions apply to individual operations


t

can be expressed in terms of component state or local operation variables


pre (pos \greater 0) \and (pos \eqless num_tiles); post \result = well_at(pos) \and ~num_tiles = num_tiles - 1;

CS 612: Software Architectures

February 25, 1999

ADL Examples

20

Separate Interface and Behavior


component WellADT is subtype Matrix (beh) { state { capacity : Integer; num_tiles : Integer; well_at : Integer -> GSColor; } invariant { (num_tiles \eqgreater 0) \and (num_tiles \eqless capacity); } interface { prov gt1: GetTile (loc : Integer) : Color; prov gt2: GetTile (i : Natural) : GSColor; } operations { prov tileget: { let pos : Integer; pre (pos \greater 0) \and (pos \eqless num_tiles); post \result = well_at(pos) \and ~num_tiles = num_tiles - 1; } } map { gt1 -> tileget (loc -> pos); gt2 -> tileget (i -> pos); } }

CS 612: Software Architectures

February 25, 1999

ADL Examples

21

Merging Interface & Behavior


component WellADT is subtype Matrix (beh) { state { capacity : Integer; num_tiles : Integer; well_at : Integer -> GSColor; } invariant { (num_tiles \eqgreater 0) \and (num_tiles \eqless capacity); } services { GetTile (loc : Integer) : Color { pre (loc \greater 0) \and (loc \eqless num_tiles); post \result = well_at(loc) \and ~num_tiles = num_tiles - 1; } GetTile (i : Natural) : GSColor { pre (i \greater 0) \and (i \eqless num_tiles); post \result = well_at(i) \and ~num_tiles = num_tiles - 1; } } }

CS 612: Software Architectures

February 25, 1999

ADL Examples

22

C2SADEL
s

Interface Elements

C2 Messages

Provided interface elements

incoming requests outgoing notications Required interface elements outgoing requests incoming notications This is a greatly simplied correspondence!

CS 612: Software Architectures

February 25, 1999

You might also like