1 / 26

Pointcut -based Architectural Interface for Bridging a Gap between Design and Implementation

ECOOP Workshop RAM-SE’0 9. Pointcut -based Architectural Interface for Bridging a Gap between Design and Implementation. Naoyasu Ubayashi , Hidenori Akatoki , Jun Nomura July 7, 2009. Overview. Architecture. public class Subject{
 private Vector observers = new Vector();

effie
Download Presentation

Pointcut -based Architectural Interface for Bridging a Gap between Design and Implementation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ECOOP Workshop RAM-SE’09 Pointcut-based Architectural InterfaceforBridging a Gap between Design and Implementation NaoyasuUbayashi, HidenoriAkatoki, Jun Nomura July 7, 2009

  2. Overview Architecture public class Subject{
private Vector observers = new Vector(); private String state = “”;
public void addObserver(Observero){ … }
public void removeObserver(Observero){ … }
public void notify(){
Iteratori = observers.iterator();
while(i.hasNext() ){
Observers o = (Observer)i.next();
o.update(this);
}
} public void setState(Strings){ state = s; } public String getState() {return state; }
} Archface Program Code Bug Bidirectional Traceability ! • 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.

  3. Outline Motivation Archface Archface for Java Discussion Conclusion

  4. 1. Motivation 1. Motivation

  5. Motivating example Architectural Design (Observer Pattern) Architectural constraints (Collaborative behavior) are not preserved ! public class Subject { private String state = ""; public String getState() { return state; } public void setState(Strings) { state = s; } … } Bug Code

  6. Solution ? MDD + Code generation ?  Fine, but … Full code generation Detailed Model Descriptions Program Code Detailed model generation Architectural design should be abstract !

  7. 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.

  8. 2. Archface (= Architecture + Interface)

  9. Our Approach Architecture Architectural information is encapsulated in interfaces public class Subject{
private Vector observers = new Vector(); private String state = “”;
public void addObserver(Observero){ … }
public void removeObserver(Observero){ … }
public void notify(){
Iteratori = observers.iterator();
while(i.hasNext() ){
Observers o = (Observer)i.next();
o.update(this);
}
} public void setState(Strings){ state = s; } public String getState() {return state; }
} Archface Program Code Archface: architectural interface for bridging a gap between design modeling and implementation

  10. Architecture Descriptions Supported by Archface Signature-based Interface is insufficient. <Example: Observer Pattern> Contextual Pointcut-based Interface Component Component Collaboration Control flow, Data flow, Trace match, etc. Component-and-Connector Architecture (Structure) Collaborations among Components (Behavior)

  11. Traditional Interface vs. Archface Component Connection Expose method signatures Interface Method call Coordinate execution of program points Expose program points Archface (Pointcut) (Weave Advice)

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

  13. Verifiable Bidirectional MDD Architectural Design Designs and verifies an architecture represented byArchface Archface Implements verifiedArchface Program Code • Not only programming-level but also design-level notion • ADL for bridging a gap between architectural design and implementation

  14. 3. Archface for Java 1. Motivation

  15. Archface as ADL Observer Pattern represented by Archface [Port update] pointcut update(): execution(void update()); [Connection] connects notifyChange (port1 :cSubject.notifyObservers, port2 :cObserver.update){ around() void :port1 { port2.proceed(); } } ADL [Port notifyObservers] pointcutnotifyObservers() : cflow(execution(voidsetState(Strings))) && call(void notify());

  16. Archface as Program Interface Archface (Program Interface) Program Code (Implement exposed program points) Implement Type check + formal verification + test

  17. Bidirectional Traceability Archface supports software evolution based on bidirectional traceability. Archface can be considered as a protocol defined between architectural design and implementation.

  18. 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.

  19. Example: Figure Editor cDisplay cPoint redraw change cLine change

  20. Compiler construction Java code (class) Archface definitions Archfacecompiler Archfaceparser AspectJ code generator Aspect-Factory class generator AspectJ code (aspect) AspectJ weaver executable program

  21. 4. Discussion 1. Motivation

  22. Related Work Our approach is based on the interface mechanisms that not only enforce architectural constraints on the program implementation but also represent architectural abstractions. • 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]

  23. 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?

  24. 5. Conclusion 1. Motivation

  25. 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.

  26. Thank you for your attention. 1. Motivation

More Related