Midterm Review CSU 670 Spring 2004.

Slides:



Advertisements
Similar presentations
UML State chart/machine diagram State machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state.
Advertisements

1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
February R. McFadyen1 Polymorphism Indirection Pure Fabrication Protected Variations (Law of Demeter) More GRASP Patterns.
Oct R McFadyen1 Recall UML Class Diagram BusRoute BusStopList BusStop BusList BusPersonList Person passengers buses busStops waiting 0..*
INTERPRETER Main Topics What is an Interpreter. Why should we learn about them.
3/7/2003Bioinformatics1 How To Address Rapidly Changing Data Representations in an Evolving Scientific Domain Using Aspect-oriented Programming Techniques.
March R. McFadyen1 Principle of Least Knowledge – page 265 Principle: talk only to your immediate friends Also called Law of Demeter (LoD)
Midterm Fall 2000 solutions. Question 1 From sentence to class dictionary abstraction In this case like from object graph to class graph abstraction because.
Oct 21, R. McFadyen1 Pure Fabrication P Problem: You have a responsibility to assign to a class, but assigning it to a class in the conceptual.
3/7/2003Bioinformatics1 How To Address Rapidly Changing Data Representations in an Evolving Scientific Domain Using Aspect-oriented Programming Techniques.
Demeter and Aspects1 AOSD 2002 Tutorial: Demeter Aspect-Oriented Programming of Traversal Related Concerns in Java Demeter Research Group.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
Design Pattern Interpreter By Swathi Polusani. What is an Interpreter? The Interpreter pattern describes how to define a grammar for simple languages,
Pattern Language for AP1 Pattern Language for Adaptive Programming (AP) Karl Lieberherr Northeastern University.
Expression evaluation E : S | C. S = int. C = Op E E. Op : A | M. A = “+”. M = “*”.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Euler paths and tours.
3/7/2003 ABB rapid change 1 How To Address Rapidly Changing Data Representations in an Evolving Scientific Domain Using Aspect-oriented Programming Techniques.
Slides for Gregor Kiczales Two versions –short version: Crosscutting capabilities for Java and AspectJ through DJ (4 viewgraphs only) –long version: Controlling.
Not only mark-up languages! There are other many other grammar formalisms and tools than XML. Some of them standardized (ASN). Even XML does not always.
Semantics Connection to Traversal Graphs. Strategy: From C1 to T o1:C1 o2:C2 e go down e iff C1. )*.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
Pattern Language for AP1 Pattern Language for Adaptive Programming (AP) Karl Lieberherr Northeastern University.
CSG 7111 Structure and Interpretation of an Aspect Language for Datatype Karl Lieberherr.
Chapter 10 Graph Theory Eulerian Cycle and the property of graph theory 10.3 The important property of graph theory and its representation 10.4.
Overview of Previous Lesson(s) Over View  Symbol tables are data structures that are used by compilers to hold information about source-program constructs.
Problem with Java and how it causes a problem for DJ.
Transparency No. 4-1 Formal Language and Automata Theory Chapter 4 Patterns, Regular Expressions and Finite Automata (include lecture 7,8,9) Transparency.
Pattern Language for AP1 Pattern Language for Adaptive Programming (AP) Karl Lieberherr Northeastern University.
R-customizers Goal: define relation between graph and its customizers, study domains of adaptive programs, merging of interface class graphs.
UBC software modularity group 1/14/02 UCSD1 Discussion with Kiczales at UBC Ontology of AOP Ontology is the study of what there is, an inventory of what.
Overview of Previous Lesson(s) Over View  A token is a pair consisting of a token name and an optional attribute value.  A pattern is a description.
AO Mechanisms in Demeter1 Discussion with Gregor Kiczales at UBC Ontology of AOP Ontology is the study of what there is, an inventory of what exists. An.
Pattern Language for AP1 Pattern Language for Adaptive Programming (AP) Karl Lieberherr Northeastern University.
Features of AOP languages AOP languages have the following main elements: –a join point model (JPM) wrt base PL –a specification language for expressing.
Viewgraphs for Semantics
Crosscutting Capabilities for Java and AspectJ through DJ
Trees Chapter 15.
Pattern Language for Adaptive Programming (AP)
Relations Chapter 9.
Structure and Interpretation of an Aspect Language for Datatype
Discussion with Gregor Kiczales at UBC
State Machine Diagrams
Chapter 12 Outline Overview of Object Database Concepts
Adaptive Object-Oriented Software Development
Presentation by Julie Betlach 7/02/2009
A Short Introduction to Adaptive Programming (AP) for Java Programmers
A Short Introduction to Adaptive Programming (AP) with collaborations and adapters Northeastern Team 11/16/2018 DJ.
Software Design and Development
ADAPTIVE PROGRAMMING Sezen ERDEM December 2005.
Review lecture AOO/Demeter.
LL(1) Parser Generators
Software Design and Development
Lecture 7 Traversals and visitors on abstract classes
A Short Introduction to Adaptive Programming (AP) for Java Programmers
AP/DJ AP: a generic technology
Lecture 21: Crosscutting Aspect-Oriented Programming Background
Better Separation of Crosscutting Concerns with Aspectual Components
CSE322 Regular Expressions and their Identities
Requirements for better object-oriented design and programming languages Could be organized better.
Specification and Efficient Implementation (Graph Theory of OOP/OOD)
Chapter 14 Graphs © 2006 Pearson Addison-Wesley. All rights reserved.
AOSD and the Law of Demeter: Shyness in Programming
Software Development CSU 670 Karl Lieberherr
Aspects at the Design Level
Objects, components, and Frameworks with UML
Karl Lieberherr Doug Orleans
Lecture 7 Frameworks and AP Notations for strategies
Presentation transcript:

Midterm Review CSU 670 Spring 2004

AP Late binding of data structures Programming without accidental data structure details yet handling all those details on demand without program change

Concepts needed (DJ classes) ClassGraph Strategy Visitor ObjectGraph TraversalGraph (efficiency) ObjectGraphSlice (efficiency)

Strategy ClassGraph ObjectGraph Adaptive Programming is use-case based Bold names refer to DJ classes. is use-case based abstraction of ClassGraph New: abstractions of class diagrams notice affinity to design patterns: some of them also talk about families of class structures explain strategies defines family of ObjectGraph

Strategy ObjectGraph ObjectGraphSlice Adaptive Programming defines traversals of ObjectGraph plus Strategy defines explain strategies ObjectGraphSlice

Strategy Visitor Adaptive Programming guides and informs explain strategies Visitor

Software Design and Development with DJ (very brief) Functional decomposition into generic behavior Decomposition into methods Decomposition into formal traversal strategies Decomposition into visitors Adaptation of generic behavior Identify class graph Identify traversal strategies

Definition: Class Graph A class graph is a directed graph with a partial order on the nodes. We write c1 -> c2 for the edges (construction edges) and c1 <= c2 for the order (inheritance edges -- c1 is a subclass of c2). We write => for the inverse of <=.

Relations We think of directed graphs as relations. Write C(c1,c2) or c1 C c2 for edge from c1 to c2 in C. Composition of relations by . E.g., x (R.S) z iff there is a y such that xRy and ySz. R* is the reflective transitive closure of a relation R.

Strategy: From X1 to T o1:X1 o2:X2 declared type of target of e is X3 =>X2 e go down e iff X1 <=.e X3 =>.(<=.C.=>)*.<=) T if only construction edges: go down e iff X1 e X3 C* T

z Strategy S -> T x X1 Y1 Z1 y S X2 Y2 Z2 T t X3 Y3 Z3 x y z t s1:S x31:X3 y31:Y3 z31:Z3 t1:T go down e iff S <=.C X1 =>.(<=.C.=>)*.<=) T

z Strategy S -> T x X1 Y1 Z1 y S X2 Y2 Z2 T t X3 Y3 Z3 x y z t s1:S x31:X3 y31:Y3 z31:Z3 t1:T go down e iff S <=.C X1 =>.(<=.C.=>)*.<=) T

z Strategy S -> T x X1 Y1 Z1 y S X2 Y2 Z2 T t X3 Y3 Z3 x y z t s1:S x31:X3 y31:Y3 z31:Z3 t1:T <=,=> not used go down e iff S <=.C X1 =>.(<=.C.=><=.C.=><=.C=>).<=) T

Example strategy A -> T T -> D a1:A 0..1 :D r1:R X 0..1 B c1:C s1:S D A C s2:S t1:T 0..1 r2:R object graph R S T 0..1 c2:C class graph d2:D go down e iff A <=.C R =>.(<=.C.=>)*.<=) T

Example 2 S = from BusRoute through Bus to Person busStops BusRoute BusStopList buses 0..* NGasPowered BusStop BusList waiting 0..* passengers Bus PersonList Person 0..* DieselPowered

Example 2 OG : BR BL DP PL P OG’: BR BL B PL P SG : BR B P Only node paths shown for space reasons Route1:BusRoute BusList buses busStops :BusStopList Bus15:DieselPowered passengers CentralSquare:BusStop waiting :PersonList :PersonList Joan:Person Paul:Person Seema:Person Eric:Person S = from BusRoute through Bus to Person

Example 3 OG : BR BL OG’: BR BL SG : BR Only node paths shown for space reasons early termination Route1:BusRoute BusList buses busStops :BusStopList Bus15:DieselPowered passengers CentralSquare:BusStop waiting :PersonList :PersonList Joan:Person Paul:Person Seema:Person Eric:Person S = from BusRoute via NGasPowered to Person

A simple view of traversals When a traversal reaches a target node in the object graph, the path traversed from the source, with suitable substitution of subclasses by superclasses, must be an expansion of an s-t path in the strategy graph. s is the source and t is the target of the strategy. Each edge in the strategy graph corresponds to at least one edge in the object graph.

A simple view of traversals When a traversal reaches a final node in the object graph without being at a target, the path traversed from the source, with suitable substitution of subclasses by superclasses, must be a prefix of an expansion of an s-t path in the strategy graph. The prefix is the longest prefix such that there is still a possibility of success as determined by the class graph.

Object Graph Slice The object graph slice starting with o1 is the slice built by following the edges selected by the path regular expression starting at o1 and continuing until every path terminates (at an object of type t or if it terminates prematurely). go down e iff X1 <=.e X3 =>.(<=.C.=>)*.<=) T

Strategy definition: embedded, positive strategies Given a graph G, a strategy graph S of G is any subgraph of the transitive closure of G. The transitive closure of G=(V,E) is the graph G*=(V,E*), where E*={(v,w): there is a path from vertex v to vertex w in G}.

Transitive Closure busStops BusRoute BusStopList buses 0..* BusStop BusList waiting 0..* passengers Bus PersonList Person 0..*

Strategy graph and base graph are directed graphs Key concepts Strategy graph S with source s and target t of a base graph G. Nodes(S) subset Nodes(G) (Embedded strategy graph). A path p is an expansion of path p’ if p’ can be obtained by deleting some elements from p.

class dictionaries (11 kinds) inductive nonleft-recursive 9 10 11 8 7 6 1 2 LL(1) 3 1: ideal case 2: JavaCC does not complain (Oct. 30 1997). Grammar contains useless symbols. Ok if we don’t want to parse but forces cyclic objects. 4 nonambiguous 5 Venn Diagram 12/30/2018 AOO / Demeter

Patterns Patterns Structure-shy Traversal Selective Visitor Structure-shy Object Class Graph Growth Plan Pattern

Three layers of Demeter instance of defines classes Demeter behavior and aspect files B: metamodel L: model P: user objects CB your behavior and aspect files CL metamodel OB classes model OL TB user object OP a class dictionary for class dictionaries objects TL class dictionary TP text sentence

Icon Use as reminder for Demeter Tiling. Demeter Tiling CB OB CL TB OL TL OP TP

Example ??? Demeter Tiling CB OB CL Basket TB OL TL OP TP aBasket:Basket With respect to the project class dictionary as OB

Example Vertex (or Ident) Demeter Tiling CB OB CL Basket TB OL TL OP TP Basket aBasket:Basket With respect to the project class dictionary as OB

Example ??? Demeter Tiling CB OB CL Regular_Syntax TB OL TL OP TP aRegular_Syntax:Regular_Syntax With respect to the project class dictionary as OB = OL

Example Vertex Demeter Tiling CB OB CL Regular_Syntax TB OL TL OP TP aRegular_Syntax:Regular_Syntax With respect to the project class dictionary as OB = OL

Example ??? Demeter Tiling CB OB CL TB OL TL OP TP Labeled = <label_name> Ident ... <b> With respect to the project class dictionary as OB = OL

Example Adjacency = <source> Vertex ... Demeter Tiling CB OB CL TB OL TL OP TP Labeled = <label_name> Ident ... <b> With respect to the project class dictionary as OB = OL

Example ??? Demeter Tiling CB OB CL TB OL TL OP TP Adjacency = <source> Vertex ... A = <b> B <b> B. With respect to the project class dictionary

Example Adjacency = <source> Vertex ... Demeter Tiling CB OB CL TB OL TL OP TP Adjacency = <source> Vertex ... A = <b> B <b> B. With respect to the project class dictionary

Lightweight Software Development Method Extreme Programming lots of testing, write test cases early incremental development pair programming

UML class diagrams object diagrams