Requirements for better object-oriented design and programming languages

Post on 22-Jan-2016

55 views 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 of Requirements for better object-oriented design and programming languages

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.

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

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

Current way of APG

s1s3s2 s5s4

Better way of APG

s1s3s2 s5s4

s7s6

s6, s7 shield s1 through s5 from changes to G

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

RequirementsComposition of strategies

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

• Class graphs and strategy graphs should have similar syntax

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

Requirements

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

• from Cabinet

bypassing ->*,*poison*,*

to *

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)

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

Requirements: Backward edges

• How should they be supported?

• Pattern for derived edges

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.

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.

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

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

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

RequirementsContainer classes

• Support multiple container classes

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

• Integrate with collection class generator P3?

RequirementsAPPCs

• Encapsulate class extensions for groups of collaborating classes

• May be parameterized by multiple strategies

RequirementsAPPCs

• an APPC can ask about results of other APPCs

• the composition structure of APPCs is a dag

RequirementsPhysical Organization

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

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