Professional Documents
Culture Documents
The software architecture of a program or computing system is the structure (or structures) of the system The structures comprise: Software components Externally visible properties of the components Relationships between the components
Architectural Patterns
Same system may have different structures i.e different architectures However, there are some structures and related constrains which appear in many systems These are general structures which are useful for architectures of a class of problem These are known as Architectural Patterns
Model Checking
Model checking is an automatic technique for verifying nite state concurrent systems It comprises of three parts A framework for modeling systems, description language of some sort typically a
A specication language for describing the properties to be veried A Verication method to establish whether description of a system satises the specication
True:Satises formula
Software architecture are essential engineering artifacts used in the design process of complex software system They specify at a high abstraction level various aspects of the system Advantage of model checking is the early analysis or verication of software architecture Software architect will be able to correct the errors early in design
CCS is a process algebra developed for analytical modeling of concurrent communicating systems CCS considers a system as a network of component which behave according to their specication Each part is an agent Agents communicate with each other via ports CCS provides similar kind of abstractions, as in Component and connector view of Software architecture
Formalization of Software Architecture : Dharmendra 8
Syntax of CCS E is the set of agent expressions which includes X set of agent variables and K set of agent constants and formed as following : 1. .E, a P ref ix ( Act) 2. iI Ei, a Summation (I an indexing set) 3. E1|E2, a Composition 4. E\L, a Restriction(L L) 5. E[f ], a Relabeling (f a relabeling function)
Formalization of Software Architecture : Dharmendra 9
The semantics of CCS For assigning meaning general notion of labeled transition system will be used (S, T, {: t T }) It consists of a set S of states, a set T of transition labels, t and a transition relation S S for each t T S is E, the agent expression, and T is Act, the actions The semantics for E consists in the denition of each transition over E Transitions of each composite agent will be dened in terms of the transitions of its component agent or agents
Formalization of Software Architecture : Dharmendra 10
.E E
(j I)
E E Com1 E|F E |F
Com3 E E F F E|F E |F
Res E E (, E\LE \L
L) /
Rel
E E E[f ] E [f ]
f ()
def P P Con (A AP
P )
11
An example: Vending Machine A big chocolate costs 2p, a little one costs 1p Only 2p and 1p coins can be used in the machine
big little
2p
1p
collect
Machine V can be dened in terms of interaction with the environment at its ports V = 2p.big.collect.V + 1p.little.collect.V
Formalization of Software Architecture : Dharmendra 12
def
Modal Mu-Calculus
Expressive logic that can be used to encode a variety of temporal logics The Syntax of Modal Mu-calculus: Formula variables X1,X2,... Atomic propositions p1,p2,..... Negation, conjunction and disjunction of formulae Existential modality: a f Universal modality: [a]f Least xed point: X.f (X) Greatest xed point: X.f (X)
13
14
We Model Web Proxy Pattern using CCS We write interesting properties of the web proxy pattern We verify using CWB-NC that model satises the property
15
We Model Proxy Pattern using CCS We write interaction properties of Proxy Pattern We verify using CWB-NC that interaction properties hold over model
16
reply
reply
CLIENT = req.ans.CLIENT PROXY = req.ans.PROXY + req.request.reply.ans.PROXY SERVER = request.reply.SERVER ARCHITECTURE = CLIENT | PROXY|SERVER
17
18
19
20
True:Satises formula
21
Component Adaptation What is a component? Component Adaptation Techniques Specifying Component Specifying Adapters Derivation of Adapters Implementation of Adapter
22
What is a component?
From an ontological point of view, everything that can be composed into composite is component The components characteristic properties are that it: is a unit of independent deployment is a unit of third party composition has no persistent state
23
Component Adaptation
Components to interoperate properly there should not be a mismatch in interfaces and behavior Wide gap between customer requirements and developer specications of the components
24
For the growth of Component Based Software Engineering (CBSE) the crucial issues of differences need to be resolved Component Adaptation is one solution to the issue Component adaptation is a technique of tailoring the component for the use in specic application development
25
26
Adaptation Techniques Copy Paste Inheritance Wrapping Superimposition Filter Based Adaptation
27
Modeling of Component Adaptation Need to formalize Component Adaptation Deadlock Freedom and Temporal Properties Adapters What to formalize Interfaces Protocols/Behaviours How to formalize State/Transition Diagram Process Algebra
28
Specication using Process Algebra Input and output actions are represented by x?(d) and x!(d) x is the link along which the actions are performed d is a tuple of parameters (either links or data) sent or received along x Non-observable actions (also called silent actions) are denoted by tau 0 represents inaction Restriction, (x)E, represents the creation of a new link name x in an expression E
Formalization of Software Architecture : Dharmendra 29
The matching operator [x=y]E is used for specifying conditional behaviour: [x=y]E behaves as E if x=y, otherwise as 0. Nondeterministic choice (+) and parallel || operators are dened: E+E may proceed either to E or to E, while E||E consists of expressions E and E acting in parallel.
30
Component interfaces consist of a set of roles Specication of role has two parts 1. Signature Interface 2. Interaction Behaviour
role role Name = { signature input and output actions behaviour interaction pattern }
31
Behaviour Description of a role consists of an interaction pattern Patterns are described by means of a subset of the polyadic pi-calculus The pi-calculus allows link names to be sent and received as values Interaction patterns are dened as follows:
E ::=0|a.E | (x)E | [x=y]E | E||E | E + E a ::= tau | x?(d) | x!(d)
32
Role I1
I1=read?(x).0 + tau.break.0
Role I2
I2=tau.fwrite!(x).0 + tau.fclose!( ).0
33
Adapter derivation Using Process Algebra Adaptation is not simply unifying link names
role P1 = { signature request!(Data url); reply ? (Data page); behaviour request!(url).reply?(page).0 } role Q1 = { signature query?(Data handle); return! behaviour query?(handle).return! } (file).0 (Data file);
35
36
37
38
Given a mapping M, and the interaction patterns P and Q of two components, concrete adapter (if any) is generated by means of a fully automated procedure. This adapter A is the component-in-the-middle such that: The parallel composition P|A|Q do not deadlock, and A will satisfy all the action correspondences and data dependencies specied by M.
39
Future Directions
Adapters can be specied using process Algebra method and could be automatically synthesized Only Interface Adaptation is provided till now Most of the current works on the component adaptation deal with adapting behaviour Functionality which is the actual semantics of the computations associated to these interactions is still a major challenge
40
Thank you
41
42
The syntax of the Milners Calculus A is the set of names. a, b, c... ranges over it A is the set of co-names.a, b, c, ... ranges over it L = A A is the set of labels. l, l ranges over it is perf ect or silent action Act = L is the set of actions. , ... ranges over it K, and L are subsets of L L is the set of complements of labels in L A relabeling f unction f is a function from L to L such that f (l) = f (l),
Formalization of Software Architecture : Dharmendra 43
f is extended to Act by decreeing that f ( ) = . X is a set of agent variables, and X, Y, ... range over X K is a set of agent constants, and A, B, ... range over K I or J are an indexing set, family of expressions indexed by I can be denoted by Ei : i I E is the set of agent expression, E, F, ... range over E.
44
E is the smallest set which includes X and K and contains the following expression, where E, Ei are already in E: 1. .E, a P ref ix ( Act) 2.
iI
45
The syntax of the Milners Calculus ( P ref ix operator) . P ref ix operator prexes an action to a single agent expression Prex is the only method of sequencing to dene the sequential composition An agent C is a cell which may hold a single data item
in C out
The cell has two ports, C may accept an item or value at the left-hand port, labeled in When holding a value, it may deliver it at the right-hand port, labeled out
Formalization of Software Architecture : Dharmendra 46
The syntax of the Milners Calculus ( P ref ix operator) (Cont..) We express the behavior of C as follows: C C (x)
def
def
The Prex in(x). stands for a handshake in which a value is received at port in and becomes the value of variable x in(x).C (x) is an agent expression; its behavior is to perform the described handshake and then proceed according to the denition of C out(x).C is an agent expression, its behavior is to output the value of x at port out and then proceed according to the denition of C
Formalization of Software Architecture : Dharmendra 47
Special cases for the summation operator are: 1. when I = {1, 2} then it turns out to be binary summation E1 + E2
Formalization of Software Architecture : Dharmendra 48
2. When I = then it gives us the inactive agent, capable of no action whatsoever. def The agent is given special name 0, and dened as 0 = i Ei .
49
The syntax of the Milners Calculus ( Composition operator) Composition is transitions possible for a composite agent P |Q in terms of the transitions possible for P and Q separately Let Aand B as follows, where a, b, c are distinct names:
a A c
def
A = a.A A = c.A
def
B = c..B B = b.B
def
def
The composite agent A|B will follow the following transition rule for the composition:
Formalization of Software Architecture : Dharmendra 50
a A
1. If A can do an action alone, then it can also do the action in context A|B, leaving B undisturbed and vice versa. Thus:
Since A A ,
a
we infer A|B A |B
we infer A |B A|B
we infer A |B A|B
51
action
52
The syntax of the Milners Calculus ( Restriction operator) \ restriction operator is a unary postxed operator It internalizes the ports of the agents restricting for further composition If P P then infer P \L P \L provided that , L /
53
The syntax of the Milners Calculus ( Relabeling operator) A function f from labels to labels is a relabeling f unction if it respects complements, For each relabeling function f, the Relabeling combinator [f ], postxed to an agent, has the effect of relabeling the ports of the agent as dictated by f
The expression l1/l1, ..., ln/ln is for the relabeling function f for which f (li) = li and f (li) = li for i = 1, ..., n and otherwise f (l) = l
54
The syntax of the Milners Calculus (Relabeling operator)(Cont..) A simple semaphore can be dened as follows:
get Sem put
Hammer
def
get.put.Sem
A semaphore is just a resource which may be acquired and released alternatively, and we can dene the Hammer and M allet by Hammer M allet
def
def