230 likes | 387 Views
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.
E N D
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 AP G s1 s2 s3 s4 s5
Better way of AP G s6 s7 s1 s2 s3 s4 s5 s6, s7 shield s1 through s5 from changes to G
Hierarchical development of strategies s2=[A,B] s3=[A,C] s4=[A,B,D] s5=[A,C,D] G A B s1= [A,D] bypassing ... G C D s1 s2 s5 s3 s4
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 Meaning of V<-A: For aV of class V find aA of class A in aG of class G such that aA.get_s() returns aV. G 1..* A s only 1..* V 1 Strategy Graph
Derived Edge Pattern V<-A can be used in strategies. A -> V to-stop V <- A gives all neighboring adjacencies for a given adjacency. G 1..* A s only 1..* V 1 Strategy Graph
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.