1 Archface: Architectural Interface -- Bridging a Gap between Design Modeling and Implementation Naoyasu Ubayashi, Hidenori Akatoki, Jun Nomura Kyushu Institute of Technology, Japan May 17, 2009 MISE’09
Motivation Architectural design plays an important role in the software development. Robustness Reliability Maintainability However, it is not easy to create an architectural model with adequate abstraction level; implement the result of architecture modeling as a program preserving the architectural correctness; recover architecture from program code; maintain the traceability between architecture and program code; and deal with software evolution. 2 public class Subject{ private Vector observers = new Vector(); private String state = “”; public void addObserver(Observer o){ … } public void removeObserver(Observer o){ … } public void notify(){ Iterator i = observers.iterator(); while(i.hasNext() ){ Observers o = (Observer)i.next(); o.update( this ); } } public void setState(String s){ state = s; } public String getState() {return state; } } Program Code Bidirectional Traceability ! Architecture Bug
Our Approach 3 Architecture Program Code Archface Archface: architectural interface for bridging a gap between design modeling and implementation Archface integrates not only design modeling with its implementation but also AO with OO. Architectural information is embedded into interfaces public class Subject{ private Vector observers = new Vector(); private String state = “”; public void addObserver(Observer o){ … } public void removeObserver(Observer o){ … } public void notify(){ Iterator i = observers.iterator(); while(i.hasNext() ){ Observers o = (Observer)i.next(); o.update( this ); } } public void setState(String s){ state = s; } public String getState() {return state; } }
Architecture Descriptions Supported by Archface Component-and-Connector Architecture Collaborations among Components 4 Component Collaboration Signature-based Interface is insufficient. Contextual Pointcut-based Interface Control flow, Data flow, Trace match, etc.
Verifiable Bidirectional MDD Not only programming-level but also design-level notion ADL for bridging a gap between architectural design and implementation 5 Architectural Design Archface Program Code Designs and verifies an architecture represented by archface Implements verified archface
Archface as ADL 6 Observer Pattern represented by Archface ADL
Archface as Program Interface 7 Archface (Type) Implement Program Code Type check + formal verification + test
Open Issues Which class of architecture is bi- directional ? Currently, we consider control flow only… Which class of architecture descriptions can be statically verified? Which description should be tested? 8
Appendix 9
Layered Model 10 Component Connection Component-and-Connector Architecture Contextual Info. Control/Data flow, etc. Contextual Info. Control/Data flow, etc. Type Check (Port check) Type Check (Port check) Alloy (Instance-level connection) Alloy (Instance-level connection) Model Checking (Behavior) Model Checking (Behavior) Test Verification/Validation
Related Work ArchJava [Aldrich, J. et al. 2002] Design pattern implementation in Java and AspectJ [Hannemann, J. 2002] 11