APPCs revisited 2/25/2019 APPCs revisited.

Slides:



Advertisements
Similar presentations
The Singleton Pattern II Recursive Linked Structures.
Advertisements

Interprocedural Slicing using Dependence Graphs Susan Horwitz, Thomas Reps, and David Binkley University of Wisconsin-Madison.
Ch. 2 Exploring core JUnit. This chapter covers ■ Using the core JUnit classes ■ Understanding JUnit mechanisms ■ Understanding the JUnit lifecycle.
Week 8 Recap CSE 115 Spring Composite Revisited Once we create a composite object, it can itself refer to composites. Once we create a composite.
The Application of Graph Criteria: Source Code  It is usually defined with the control flow graph (CFG)  Node coverage is used to execute every statement.
Encapsulation, Inheritance & Interfaces CSE 115 Spring 2006 February 27, March 1 & 3, 2006.
Systems Analysis and Design in a Changing World, Fifth Edition
Chapter 12 Inheritance and Exceptions Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas,
Demeter Interfaces: AP without Surprises Prof. Karl Lieberherr and Therapon Skotiniotis, Jeffrey Palm.
Change Impact Analysis for AspectJ Programs Sai Zhang, Zhongxian Gu, Yu Lin and Jianjun Zhao Shanghai Jiao Tong University.
Integrating Independent Components with On-Demand Remodularization based on OOPSLA 2002 paper by Mira Mezini Klaus Ostermann Prepared by Karl Lieberherr.
Expression evaluation E : S | C. S = int. C = Op E E. Op : A | M. A = “+”. M = “*”.
Generative Programming. Automated Assembly Lines.
Slides for Gregor Kiczales Two versions –short version: Crosscutting capabilities for Java and AspectJ through DJ (4 viewgraphs only) –long version: Controlling.
Systems Analysis and Design in a Changing World, 3rd Edition
1 Chapter 8 – Classes and Object: A Deeper Look Outline 1 Introduction 2 Implementing a Time Abstract Data Type with a Class 3 Class Scope 4 Controlling.
Semantics Connection to Traversal Graphs. Strategy: From C1 to T o1:C1 o2:C2 e go down e iff C1. )*.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Programming With Java ICS201 University Of Ha’il1 Chapter 7 Inheritance.
CS 210 Final Review November 28, CS 210 Adapter Pattern.
Translating Traversals to AspectJ. Outline Motivation Demeter Process for Traversals AspectJ Translation Process.
DJ: traversal-visitor-style programming in Java Josh Marshall/ Doug Orleans Want to add more on traversal through collections and Aspectual Components.
Chapter 3: Introducing the UML
Example to motivate discussion We have two lists (of menu items) one implemented using ArrayList and another using Arrays. How does one work with these.
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
Introduction to SSA Data-flow Analysis Revisited – Static Single Assignment (SSA) Form Liberally Borrowed from U. Delaware and Cooper and Torczon Text.
AOP/cross-cutting What is an aspect?. An aspect is a modular unit that cross-cuts other modular units. What means cross-cutting? Apply AOP to AOP. Tease.
Basic Concepts and Definitions
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Control Flow Graphs : The if Statement 1 if (x < y) { y = 0; x = x + 1; } else { x = y; } x >= yx < y x = y y = 0 x = x + 1 if (x < y) { y = 0;
R-customizers Goal: define relation between graph and its customizers, study domains of adaptive programs, merging of interface class graphs.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Features of AOP languages AOP languages have the following main elements: –a join point model (JPM) wrt base PL –a specification language for expressing.
Modern Programming Tools And Techniques-I
Paul Ammann & Jeff Offutt
Sections Inheritance and Abstract Classes
Graphs Chapter 15 introduces graphs which are probably the most general and commonly-used data structure. This lecture introduces heaps, which are used.
Crosscutting Capabilities for Java and AspectJ through DJ
MPCS – Advanced java Programming
Good for DJ over Java Extending traversals for collections (b..*)
Linzhang Wang Dept. of Computer Sci&Tech, Nanjing University
Input Space Partition Testing CS 4501 / 6501 Software Testing
Software Engineering Fall 2005
Section 11.1 Class Variables and Methods
ATS Application Programming: Java Programming
Lecture 8 Style rules: Class graph minimization
Object Oriented Programming
Stack Lesson xx   This module shows you the basic elements of a type of linked list called a stack.
Presentation by Julie Betlach 7/02/2009
Python Classes By Craig Pennell.
Lecture 6 Project review
Interactions.
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Jim Fawcett CSE776 – Design Patterns Summer 2003
Planning José Luis Ambite.
Advanced Java Programming
Third lecture Review Visitor pattern DemeterJ 12/25/2018 SD.
Third lecture Review Visitor pattern DemeterJ 2/17/2019 SD.
Objects First with Java A Practical Introduction using BlueJ
Requirements for better object-oriented design and programming languages Could be organized better.
Context Objects Evolution of object behavior Behavioral patterns
Lecture 8 Evolution of object behavior Behavioral patterns
Strategy Design Pattern
Reference These slides, with minor modification and some deletion, come from U. of Delaware – and the web, of course. 4/4/2019 CPEG421-05S/Topic5.
Reference These slides, with minor modification and some deletion, come from U. of Delaware – and the web, of course. 4/17/2019 CPEG421-05S/Topic5.
Objects First with Java A Practical Introduction using BlueJ
List Iterator Implementation
Visitor Pattern Intent
Implementation Plan system integration required for each iteration
Presentation transcript:

APPCs revisited 2/25/2019 APPCs revisited

APPCs: motivation Want classes and collaborations Want variation-oriented programming incremental change of collaborations by code addition instead of individual class editing Want traversal strategies structure-shyness and partially automated evolution 2/25/2019 APPCs revisited

Composition of APPCs, strategies and class graphs Strategy types gv1 gv2 st1 st1 st1 s1 s1 = refinement of st1 for CG1 Class graphs gv1 CG1 CG2 gv2(gv1)(s1 CG1) s1 gv2 instantiated behavior 2/25/2019 AOO

Loose coupling C S Strategy graphs Class graphs Each unit should hard-code as few assumptions as possible on the concrete form of the others. F APPCs 2/25/2019 AOO

Roles of strategy graph Participant management role define set of participants reachable from a class-valued variable define participant transportation participant name : abbreviation for path or reversed path Super-iterator role iterate while executing code of some APPC 2/25/2019 APPCs revisited

Roles of strategy graph Participant management role forward path abbreviation From a:A via b:B to c:C if unique path, c is abbreviation for path (used in A-object or B-object) backward path abbreviation if in C-object we need the last B-object visited, b is abbreviation for reversed unique path (used in C-object) 2/25/2019 APPCs revisited

Participant management role Interesting definition: unique reverse path PartList Loop does not matter for reverse path ClassDef Part Empty NonEmpty Reverse path from Part to ClassDef is unique. 2/25/2019 APPCs revisited

Super-iterator role Traverse and execute code of an APPC (visitor style). o.strategy(APPC) can be anywhere in a method f() strategy(APPC) introduce name f and then call o.f() 2/25/2019 APPCs revisited

Playing both roles Participant management role and super-iterator role. Adjacency to edge-list translation participant transportation along unique backward paths (backward path abbreviation) use same strategy as super-iterator Pricing set of participants along unique paths (forward path abbreviation) us same strategy as super-iterator 2/25/2019 APPCs revisited

APPC Consists of provided interface required interface implementation methods to class-valued variables output port to other components required interface methods from class-valued variables interface to class graph: paths required input ports from other components implementation 2/25/2019 APPCs revisited

APPC Required interface methods from class-valued variables interface to class graph: paths required A set of traversal strategies for participant management (unique forward and backward paths) as super-iterators input ports from other components 2/25/2019 APPCs revisited

APPC Implementation methods: refer to participants methods may call next(): result from next component next().n: result from component n subtraversal().s: continue traversal following strategy edge s ???? 2/25/2019 APPCs revisited

Compositionality and referring to traversals in APPC code Should keep it simple: go_on() (or next()) should be only way to talk about what to do next. Reason: we want to compose several APPCs and if each of them talks about its own way of navigation, it is not clear what composition means 2/25/2019 APPCs revisited

Kinds of APPCs Visitor style Adjuster style single-traversal collaborations addition or modification for duration of traversal Adjuster style multi-traversal collaborations add statically new methods to groups of classes statically modify methods in groups of classes 2/25/2019 APPCs revisited

Both kinds Parameterized by strategies class-valued variables method-valued variables 2/25/2019 APPCs revisited

Kinds of APPCs Visitor style single-traversal collaborations single strategy parameter, uniform single method name backbone of collaboration calls subtraversal().s // follow down strategy edge s ???? 2/25/2019 APPCs revisited

Kinds of APPCs Adjuster/Contract style multi-traversal collaborations several strategy parameters different method names 2/25/2019 APPCs revisited

Role of strategy graph At some class A we don’t call next() only. Can call subtraversal().x and subtraversal().y with any Java code in between. ??? Strategy graph describes where we might traverse: is the case anyway with around methods. ??? 2/25/2019 APPCs revisited

APPCs: visitor style APPC A (St1 s1){ instance variables methods B { // redefines node code instance variables, methods void my_role(){ { … next(); … } } -> X,y,Y { // redefines edge code void my_role() { … next(); … } St1 strategy type describing the collaboration. K,L appear in St1 2/25/2019 APPCs revisited

Structure of an APPC (visitor style) APPC (Strategy s, Method m1,…,mk){ // visitor style has only one strategy argument //variables global for traversal init()… return()… start()… final()… s.source //variables that temp. extend host object my_role() host.m1();… next-visitor.return;… next(); host.localMethod1();… localMethod1()(@ … @);… }// end of APPC 2/25/2019 AOO

APPC: adjuster style APPC A (St1 s1, St2 s2, …){ B { void f1() { { x.f2(); … next(); …} } C { void f2() { … Add new methods f1 and f2 to classes B and C, respectively. 2/25/2019 APPCs revisited

Open issues Composition of APPCs order modifies/assumes/extends uses Integrate visitor style and adjuster style? Visitor a special case of adjuster style Injecting APPCs into class graph 2/25/2019 APPCs revisited

Open issues Subtraversals: strategic traversal automaton using APPCs as arguments to other APPCs or parts of them like a uses relationship 2/25/2019 APPCs revisited