requirements for better object-oriented design and programming languages

23
Requirements for better object-oriented design and programming languages • Could be organized better

Upload: azure

Post on 22-Jan-2016

55 views

Category:

Documents


0 download

DESCRIPTION

Requirements for better object-oriented design and programming languages. Could be organized better. General Requirements. Minimize tangling (most important) tangling of behaviors/issues structure-shyness Do type-checking at adaptive level without knowledge of class graph. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Requirements for better object-oriented design and programming languages

Requirements for better object-oriented design and programming

languages• Could be organized better

Page 2: Requirements for better object-oriented design and programming languages

General Requirements

• Minimize tangling (most important)– tangling of behaviors/issues – structure-shyness

• Do type-checking at adaptive level without knowledge of class graph.

Page 3: Requirements for better object-oriented design and programming languages

RequirementsStrategic Automata

• Support strategic traversal automata

• Strategy graph defines 4 kinds of automata: depth-first/breadth-first and class-graph-order/strategy-graph-order

• If another traversal is needed, use strategic traversal automaton

• traversal automaton is special case: apply to class graph

Page 4: Requirements for better object-oriented design and programming languages

Requirements:Layers of strategy graphs

• Allow multiple layers to define strategies. Allows to protect strategies from details of class graphs

• Path set is defined by intersection of NDFAs from current strategy to the root

Page 5: Requirements for better object-oriented design and programming languages

Current way of APG

s1s3s2 s5s4

Page 6: Requirements for better object-oriented design and programming languages

Better way of APG

s1s3s2 s5s4

s7s6

s6, s7 shield s1 through s5 from changes to G

Page 7: Requirements for better object-oriented design and programming languages

Hierarchical development of strategies

A B

C D

s2=[A,B]

s3=[A,C]

s4=[A,B,D]

s5=[A,C,D]

G

s1= [A,D] bypassing ...G

s1

s2 s3 s4 s5

Page 8: Requirements for better object-oriented design and programming languages

RequirementsComposition of strategies

• Support intersection, merge, negation and join of strategies. Allow naming of strategies.

• Class graphs and strategy graphs should have similar syntax

Page 9: Requirements for better object-oriented design and programming languages

Example: RequirementsComposition of strategies

• support operations join and merge– S1 = A=B.B=C.C=.– S2 = A=X.X=Y.Y=C.– S3 = A=Y.Y=X.X=C.– S4 = S1 & (S2 + S3)

• join and merge help to avoid long specifications

Page 10: Requirements for better object-oriented design and programming languages

Requirements

• To make strategies even more adaptive, we allow regular expressions in class-valued and relation-valued variables.

• from Cabinet

bypassing ->*,*poison*,*

to *

Page 11: Requirements for better object-oriented design and programming languages

Requirements

• {-> Document

{[Ss]ection [Pp]aragraph}}• Does not matter: lower case or upper case

• Used in the Laurel Query Language: (Abiteboul et al., Journal of Digital Libraries, 1(1), 1997)

Page 12: Requirements for better object-oriented design and programming languages

RequirementsControl by strategies

• during strategy: during s …– restrict visitor to strategy s

• start strategy: start s …– before traversal starts, execute some code

• finish strategy: finish s ...

Page 13: Requirements for better object-oriented design and programming languages

Requirements: Backward edges

• How should they be supported?

• Pattern for derived edges

Page 14: Requirements for better object-oriented design and programming languages

Derived Edge Pattern

G

A

V

1..*

1..*sonly

1

Strategy Graph

Meaning of V<-A: For aV of class Vfind aA of class A in aGof class G such thataA.get_s() returns aV.

Page 15: Requirements for better object-oriented design and programming languages

Derived Edge Pattern

G

A

V

1..*

1..*sonly

1

Strategy Graph

V<-A can be used in strategies.

A -> V to-stopV <- A

gives all neighboringadjacencies for a givenadjacency.

Page 16: Requirements for better object-oriented design and programming languages

RequirementsVisitors

• visitors can be composed into a tree: a tree expression binds them together

• a visitor can refer to several next visitors which provide it with inputs: next_visitor.x.result()

• a visitor has one output

Page 17: Requirements for better object-oriented design and programming languages

Visitors

• Visitor composition– as part of visitor definition– by independent visitor expressions

• Each visitor is parameterized by one strategy which serves as a strategy type. When instantiated with detailed strategy, behavior is defined (like adaptive method).

Page 18: Requirements for better object-oriented design and programming languages

RequirementsObject Manipulation

• Insertion and deletion should be done in a structure-shy way.

• from A to B before B {delete this;}

• support for exiting from a traversal

Page 19: Requirements for better object-oriented design and programming languages

RequirementsContainer classes

• Support multiple container classes

• Support parameterized syntax in class dictionary: java.util.Stack(S)

• Integrate with collection class generator P3?

Page 20: Requirements for better object-oriented design and programming languages

RequirementsAPPCs

• Encapsulate class extensions for groups of collaborating classes

• May be parameterized by multiple strategies

Page 21: Requirements for better object-oriented design and programming languages

RequirementsAPPCs

• an APPC can ask about results of other APPCs

• the composition structure of APPCs is a dag

Page 22: Requirements for better object-oriented design and programming languages

RequirementsPhysical Organization

• separate files for class dictionaries(*.cd), visitors (*.vis), adjusters (*.adj) and behaviors (*.beh), strategies (*.str).

Page 23: Requirements for better object-oriented design and programming languages

Requirements Coordination: Formally verify small cases

• Coordinator defines finite state machine for small parameters.

• Use model checking techniques.

• Model checking: temporal logic versus pi-calculus. Use temporal logic. Microsoft PowerPoint

Presentation