Patterns for Architectural Analysis and Systems Integration 1 st Braga, Portugal July 2, 2011
Context Context In the context of Cloud Computing... Software deployed somewhere with illusion of infinite resources Elasticity dynamic (on-demand) allocation of resources Centralisation data + computation in the same cloud Software as a Service (SaaS) available anywhere Software is available as services (e.g. Google Apps) Services provide computation, data, etc. Services may be composed with other services (from other providers) Service Composition enforces Service-Oriented Architectures (SOA)
Context Context In the context of SOA... Service-oriented Computing is the focus Services may be seen as traditional Software Components Input and Output ports for communication (API of the Service) Provide results on demand (Web-services (WS) calls) Open Source Services as Open Source Components Reutilisation and Integration of Components are crucial topics in Service Oriented Computing
Context Context Software (Services) Integration/Composition Follows business process patterns (e.g. van der Aalst) Based on coordination methodologies (for WS) Orchestration central controller where WS are oblivion about business process or other WS in the application Choreography no central controller and WS know other WS they are communicating with Composition of components requires good architectural design phase
Motivation Motivation From the legacy code analysis/understanding stand point... Architectural decisions end up hard-wired in the application code Leads to analysis and maintenance problems Raise the need of separating the coordination from the main business code Tool support for architectural decisions discovery is becoming important
Motivation Motivation CoordInspector is a tool for architectural decisions recovery by coordination layer extraction Processes CIL code (potentially able to analyze systems developed in more than 40 languages compliant with the.net plataform) CIL code of a system is transformed into a System Dependence Graph (SDG) SDG is sliced into a Coordination Dependence Graph (CDG) CDG holds information about coordination code Coordination code is extracted from the CDG, by using graph algorithms to search for non formalised definitions of coordination code patterns
Objectives Objectives A formalisation of coordination patterns is needed Define a robust pattern language to drive the coordination layer extraction Integrate the language in CoordInspector providing: Pattern Editor Pattern Visualization Extraction Algorithm Ready-to-use Patterns (by creation of a Pattern Repository) Use of the pattern language for software integration
Outline Coordination Pattern Definition Formal Model Transition & Nodes Semantics Operations CoordL: Coordination Pattern Language Formal Specification Textual Notation Visual Representation CoordInspector Integration CoordInspector Architecture The Pattern Editor The Visualization Pattern Repository On Line Pattern Repository Local Pattern Repository Systems Integration Conclusion
Definition Coordination Pattern - Definition A Coordination Pattern is an equivalence class, a shape or sub-graph of a Coordination Dependence Graph, G, corresponding to a trace of coordination policies left in the system code
Definition Coordination Dependence Graphs (CDGs)
Definition Similar recurrent shape in the CDGs
Definition Coordination Pattern
Formal Model Coordination Pattern - Formal Model Pattern := N, in N, out N, T N ThreadRef N where: N is the set of pattern nodes; in is a set of input nodes of the pattern; out is a set of output nodes of the pattern; T is the set of transition relations: n x n n, x, n T ThreadRef is an identifier to reference an execution thread.
Transition & Nodes Semantics Transition & Nodes Semantics Transition [[n x n ]] G = j0,,j n Nodes(G). n x j 0 Fork Nodes f a,x b,y Join Nodes x x j n (p) = N { f, x }, {f } in \ {a, b}, out, T {f x x n Paths(G) a, f y b} (p) a,x b,y j = N { j, x }, in, {j} out \ {a, b}, T {a x j, b y j} Thread Trigger Nodes (p) a,x b,y i,x j,x = N { i, x, j, x }, in, {i, j} out\{a, b}, T {a x i, b y i, a x j, b y j}
Operations Operations - Aggregations Let p 1 = N 1, in 1, out 1, T 1 and p 2 = N 2, in 2, out 2, T 2. The aggregated pattern p 1 p 2 is given by p 1 p 2 = N 1 N 2, in 1 in 2, out 1 out 2, T 1 T 2
Operations Operations - Connections Let p = N, in, out, T. A connection is established between two nodes in a pattern interface through the link operator: (p) i j = x N, in \ {i}, out \ {j}, T {j i} i in j out x = thread(i) thread(j) is defined p otherwise
Operations Operations - @live Let p = N, in, out, T. The alive operator re-opens closed interface nodes in the following way: iff (p)@[i 1... i n o 1... o m ] = N, in {i 1,..., i n }, out {o 1,..., o m }, T {i 1,..., i n, o 1,..., o m } N {i 1,..., i n } in = {o 1,..., o m } out =
Coordination Pattern Definition Formal Model Transition & Nodes Semantics Operations CoordL: Coordination Pattern Language Formal Specification Textual Notation Visual Representation CoordInspector Integration CoordInspector Architecture The Pattern Editor The Visualization Pattern Repository On Line Pattern Repository Local Pattern Repository Systems Integration Conclusion
Formal Specification CoordL - Formal Specification 1 l a n g p a t t e r n+ 2 p a t t e r n ID ( p o r t s p o r t s ) { d e c l s graph } 3 p o r t s l s t I D 4 d e c l s d e c l ; ( d e c l ; ) 5 d e c l node l s t I D = n o d e R u l e s f o r k l s t I D j o i n l s t I D 6 t t r i g g e r l s t I D ID i n s t a n c e s 7 i n s t a n c e s i n s t a n c e (, i n s t a n c e ) 8 i n s t a n c e ID ( p o r t s p o r t s ) 9... 10 graph a g g r e g a t i o n c o n n e c t i o n s 11 a g g r e g a t i o n p a t t r e f ( + p a t t r e f ) 12 p a t t r e f cnode ( a g g r e g a t i o n n ) c o n n e c t i o n 13... 14 cnode node ID. proptt 15... 16 c o n n e c t i o n { o p e r a t i o n s } @ [ p o r t s a l i v e p o r t s a l i v e ] 17... 18 o p e r a t i o n cnode l i n k cnode f o r k j o i n t t r i g g e r 19... 20 f o r k node s p l i n k { cnode, cnode } 21... 22 l i n k ID > 23...
Textual Notation CoordL - Textual Notation 1p a t t e r n 1 ( p1 p4 ) { 2 node p1, p2, p3, p4 = { 3 s t == && 4 c t == w e b s e r v i c e && 5 cm == sync && 6 c r == consumer && 7 } ; 8 f o r k f ; 9 j o i n j ; 10 11 { f ( x, y ) > ( p2, p3 ) } 12 {p1 x > f, ( p2, p3 ) ( x, y ) > j } 13 { j x > p4} 14} p a t t e r n 2 ( p1 p2 ) { node p1, p2, p3 = { s t == }; p a t t e r n 1 p a t t ( i 1 o1 ) ; ( ( p1 + p a t t + p2 ) {p1 x > p a t t ( i 1 ), p a t t ( o1 ) x > p2, p2 x > p3 } @ [ p2 ] ) {p3 x > p2} } 1 2 3 4 5 6 7 8 9 10 11
Visual Representation CoordL - Visual Representation Node Fork Join Ttrigger Instance Edge pattern 1 pattern 2 Op.Edge
Coordination Pattern Definition Formal Model Transition & Nodes Semantics Operations CoordL: Coordination Pattern Language Formal Specification Textual Notation Visual Representation CoordInspector Integration CoordInspector Architecture The Pattern Editor The Visualization Pattern Repository On Line Pattern Repository Local Pattern Repository Systems Integration Conclusion
CoordInspector Architecture CoordInspector Architecture
The Pattern Editor CoordInspector - The CoordL IDE
The Visualization CoordInspector - The Visualization
Coordination Pattern Definition Formal Model Transition & Nodes Semantics Operations CoordL: Coordination Pattern Language Formal Specification Textual Notation Visual Representation CoordInspector Integration CoordInspector Architecture The Pattern Editor The Visualization Pattern Repository On Line Pattern Repository Local Pattern Repository Systems Integration Conclusion
On Line Pattern Repository On Line Pattern Repository Coordiantion Pattern is the basic piece Pattern Information is stored in an XML structure Name Abstract Motivation Applicability Implementation in real code CoordL definition Examples Known-uses Contributors Related Patterns (relations like use, simulation, bisimulation) Kewywords Classification
Local Pattern Repository Local Pattern Repository Synchronized with the online repository via Webservice Integrated in the CoordL IDE Pattern Details visualization and use provided
Coordination Pattern Definition Formal Model Transition & Nodes Semantics Operations CoordL: Coordination Pattern Language Formal Specification Textual Notation Visual Representation CoordInspector Integration CoordInspector Architecture The Pattern Editor The Visualization Pattern Repository On Line Pattern Repository Local Pattern Repository Systems Integration Conclusion
Systems Integration with CoordInspector Overall strategy:
Coordination Pattern Definition Formal Model Transition & Nodes Semantics Operations CoordL: Coordination Pattern Language Formal Specification Textual Notation Visual Representation CoordInspector Integration CoordInspector Architecture The Pattern Editor The Visualization Pattern Repository On Line Pattern Repository Local Pattern Repository Systems Integration Conclusion
Conclusion A language to define coordination patterns, CoordL, was defined with a precise semantics a visual notation and a processor for syntactic/semantic check and transformations CoordL specifications formally drive the extraction of the coordination layer of software systems. The extraction is done resorting to a graph-based search algorithm The CoordInspector tool was enriched with an Integrated Development Environment for CoordL A repository was created to support the reuse of patterns
Conclusion Further Thoughts Integration strategy based on coordination patterns analysis pattern calculus pattern analysis based on properties/invariants Possible integration of CoordInspector into CROSS portal as a plug-in Possible use of CoordInspector to integrate CROSS portal plug-ins
Patterns for Architectural Analysis and Systems Integration 1 st Braga, Portugal July 2, 2011