ECOOP Workshop RAM-SE’09
Pointcut-based Architectural Interface
for
Bridging a Gap between Design and
Implementation
Naoyasu Ubayashi, Hidenori Akatoki, Jun Nomura
July 7, 2009
POSL (Principles of Software Languages) Gr.
Kyushu Institute of Technology, Japan
http://posl.minnie.ai.kyutech.ac.jp/
POSL
posl.minnie.ai.kyutech.ac.jp
Overview
Architectural design plays an
important role in the software
development.
– Robustness
– Reliability
– Maintainability
Archface
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; } }
Bug
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.
Bidirectional Traceability !
2
POSL
posl.minnie.ai.kyutech.ac.jp
Outline
Motivation
Archface
Archface for Java
Discussion
Conclusion
3
POSL
posl.minnie.ai.kyutech.ac.jp
1. Motivation
1. MOTIVATION
4
POSL
posl.minnie.ai.kyutech.ac.jp
Motivating example
Architectural Design
(Observer Pattern)
Architectural constraints
(Collaborative behavior)
are not preserved !
Code
public class Subject {
private String state = "";
Bug
public String getState() { return state; }
public void setState(String s) { state = s; }
…
}
5
POSL
posl.minnie.ai.kyutech.ac.jp
Solution ?
MDD + Code generation ?
Fine, but …
Full code
generation
Program
Code
Detailed model
generation
Architectural design should be abstract !
6
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
POSL
posl.minnie.ai.kyutech.ac.jp
2. Archface
(= Architecture + Interface)
8
POSL
posl.minnie.ai.kyutech.ac.jp
Our Approach
Archface: architectural
interface for bridging a gap
between design modeling and
implementation
Archface
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; } }
Architectural information is
encapsulated in interfaces
9
POSL
posl.minnie.ai.kyutech.ac.jp
Architecture Descriptions Supported by Archface
Component-and-Connector Architecture (Structure)
Collaborations among Components (Behavior)
<Example: Observer Pattern>
Component
Component
Collaboration
Signature-based
Interface is insufficient.
Contextual
Pointcut-based
Interface
Control flow, Data flow,
Trace match, etc.
10
POSL
posl.minnie.ai.kyutech.ac.jp
Traditional Interface vs. Archface
Component
Interface
Archface
Connection
Expose method
signatures
Method call
Expose
program
points
(Pointcut)
Coordinate
execution of
program
points
(Weave Advice)
11
POSL
posl.minnie.ai.kyutech.ac.jp
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]
12
POSL
posl.minnie.ai.kyutech.ac.jp
Verifiable Bidirectional MDD
Not only programming-level but also
Architectural Design
design-level notion Designs and verifies an
architecture represented
ADL for bridging a gap by
between
Archface
architectural design and
implementation
Archface
Implements verified
Archface
Program Code
13
POSL
posl.minnie.ai.kyutech.ac.jp
3. Archface for Java
1. MOTIVATION
14
POSL
posl.minnie.ai.kyutech.ac.jp
Archface as ADL
Observer Pattern
represented by
Archface
[Port update]
[Connection] pointcut update():
execution(void update());
connects notifyChange
ADL (port1 :cSubject.notifyObservers,
[Port notifyObservers]
pointcut notifyObservers()
port2: :cObserver.update){
cflow(execution(void setState(String
s))) &&
call(void notify());
around() void :port1
{ port2.proceed();
}
}
15
POSL
posl.minnie.ai.kyutech.ac.jp
Archface as Program Interface
Archface
(Program Interface)
Program Code
(Implement exposed program points)
Implement
Type check
+ formal verification
+ test
16
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
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
POSL
posl.minnie.ai.kyutech.ac.jp
Example: Figure Editor
cDisplay
redraw
cPoint
change
cLine
change
19
POSL
posl.minnie.ai.kyutech.ac.jp
Compiler construction
Java code
(class)
Archface definitions
Archface parser
Archface compiler
AspectJ code
generator
Aspect-Factory
class generator
AspectJ code
(aspect)
AspectJ
weaver
executable program
20
POSL
posl.minnie.ai.kyutech.ac.jp
4. Discussion
1. MOTIVATION
21
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
Our refactoring
approach
is based
[Cazzola,
W. 2007]on the
interface
mechanisms
that not only enforce
Aspect Component:
– JAsCo [Suvee,constraints
D. et al. 2003]
architectural
on the program
implementation but also represent architectural
abstractions.
22
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
POSL
posl.minnie.ai.kyutech.ac.jp
5. Conclusion
1. MOTIVATION
24
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
POSL
posl.minnie.ai.kyutech.ac.jp
Thank you for your attention.
1. MOTIVATION
26
© Copyright 2026 Paperzz