Presentation is loading. Please wait.

Presentation is loading. Please wait.

POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface.

Similar presentations


Presentation on theme: "POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface."— Presentation transcript:

1 POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan http://posl.minnie.ai.kyutech.ac.jp/ Pointcut-based Architectural Interface for Bridging a Gap between Design and Implementation Naoyasu Ubayashi, Hidenori Akatoki, Jun Nomura July 7, 2009 ECOOP Workshop RAM-SE’09

2 POSL posl.minnie.ai.kyutech.ac.jp Overview Architectural design plays an important role in the software development. –Robustness –Reliability –Maintainability However, it is not easy to –implement the result of architecture modeling as a program preserving the architectural correctness; –maintain the traceability between an architecture and program code; and –deal with software evolution. 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 Bu g 2 Archface

3 POSL posl.minnie.ai.kyutech.ac.jp Outline Motivation Archface Archface for Java Discussion Conclusion 3

4 POSL posl.minnie.ai.kyutech.ac.jp 1. MOTIVATION 1. Motivation 4

5 POSL posl.minnie.ai.kyutech.ac.jp Motivating example public class Subject { private String state = ""; public String getState() { return state; } public void setState(String s) { state = s; } … } Architectural Design (Observer Pattern) Code Bu g Architectural constraints (Collaborative behavior) are not preserved ! 5

6 POSL posl.minnie.ai.kyutech.ac.jp Solution ? MDD + Code generation ?  Fine, but … Architectural design should be abstract ! Detailed Model Descriptions Program Code Full code generation Detailed model generation 6

7 POSL posl.minnie.ai.kyutech.ac.jp Problems to be tackled In current MDD, 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 deal with software evolution. 7

8 POSL posl.minnie.ai.kyutech.ac.jp 2. Archface (= Architecture + Interface) 8

9 POSL posl.minnie.ai.kyutech.ac.jp 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; } } Our Approach Architecture Program Code Archface: architectural interface for bridging a gap between design modeling and implementation Architectural information is encapsulated in interfaces 9 Archface

10 POSL posl.minnie.ai.kyutech.ac.jp Architecture Descriptions Supported by Archface Component-and-Connector Architecture (Structure) Collaborations among Components (Behavior) Component Collaboration Signature-based Interface is insufficient. Contextual Pointcut-based Interface Control flow, Data flow, Trace match, etc. 10

11 POSL posl.minnie.ai.kyutech.ac.jp Traditional Interface vs. Archface Interface Expose method signatures Archface Expose program points Method call Coordinate execution of program points (Pointcut) (Weave Advice) 11 ConnectionComponent

12 POSL posl.minnie.ai.kyutech.ac.jp Conceptual background Join point Architectural constraints can be specified by Pointcut & Advice Extension of ccJava [Ubayashi, et al. 2007] Three-part Modeling Framework 12 [Masuhara, et al. 2003]

13 POSL posl.minnie.ai.kyutech.ac.jp Verifiable Bidirectional MDD Not only programming-level but also design-level notion ADL for bridging a gap between architectural design and implementation Architectural Design Archface Program Code Designs and verifies an architecture represented by Archface Implements verified Archface 13

14 POSL posl.minnie.ai.kyutech.ac.jp 1. MOTIVATION 3. Archface for Java 14

15 POSL posl.minnie.ai.kyutech.ac.jp Archface as ADL Observer Pattern represented by Archface ADL 15 [Port notifyObservers] pointcut notifyObservers() : cflow(execution(void setState(String s))) && call(void notify()); [Port update] pointcut update(): execution(void update()); [Connection] connects notifyChange (port1 :cSubject.notifyObservers, port2 :cObserver.update){ around() void :port1 { port2.proceed(); } }

16 POSL posl.minnie.ai.kyutech.ac.jp Archface as Program Interface Archface (Program Interface) Implement Program Code (Implement exposed program points) Type check + formal verification + test 16

17 POSL posl.minnie.ai.kyutech.ac.jp Bidirectional Traceability Archface supports software evolution based on bidirectional traceability. Archface can be considered as a protocol defined between architectural design and implementation. 17

18 POSL posl.minnie.ai.kyutech.ac.jp Integration with AO Archface supports not only OO but also AO architecture. A weaving in AO can be realized by the component-and-connector mechanism. We do not have to distinguish crosscutting concerns from primary concerns at the architectural design phase. 18

19 POSL posl.minnie.ai.kyutech.ac.jp Example: Figure Editor 19 cDisplaycPoint cLine change redraw

20 POSL posl.minnie.ai.kyutech.ac.jp Compiler construction Archface definitions Archface parser AspectJ code generator Aspect-Factory class generator AspectJ weaver executable program Archface compiler 20 AspectJ code (aspect) Java code (class)

21 POSL posl.minnie.ai.kyutech.ac.jp 1. MOTIVATION 4. Discussion 21

22 POSL posl.minnie.ai.kyutech.ac.jp Related Work Architecture and Implementation: –ArchJava [Aldrich, J. 2002] –Design pattern implementation in Java and AspectJ [Hannemann, J. 2002] Co-evolution: –Co-evolution between design and implementation [D'Hondt, T. 2001] –Co-evolving the application design models after the code refactoring [Cazzola, W. 2007] Aspect Component: –JAsCo [Suvee, D. et al. 2003] 22 Our approach is based on the interface mechanisms that not only enforce architectural constraints on the program implementation but also represent architectural abstractions.

23 POSL posl.minnie.ai.kyutech.ac.jp 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? 23

24 POSL posl.minnie.ai.kyutech.ac.jp 1. MOTIVATION 5. Conclusion 24

25 POSL posl.minnie.ai.kyutech.ac.jp Summary Archface is not only an ADL but also a programming-level interface mechanism. The traceability between design and program code can be realized by enforcing architectural constraints specified in Archface on the program implementation. 25

26 POSL posl.minnie.ai.kyutech.ac.jp 1. MOTIVATION Thank you for your attention. 26


Download ppt "POSL (Principles of Software Languages) Gr. Kyushu Institute of Technology, Japan Pointcut-based Architectural Interface."

Similar presentations


Ads by Google