Title: Tools Project
1Tools Project
2The 5 tasks
- Each class must be defined in the class
dictionary or must be imported. - No inheritance cycle.
- Parts must be unique.
- Single inheritance.
- Terminal Buffer Rule.
3Extreme programming
- Important feature
- Write test cases early.
4Parts must be unique
- A ltbgt B ltbgt C. B . C .
- A J K common ltbgt B.
- J ltbgt C. K .
- Reduce second case to first case by flattening.
- Use above examples as test cases.
5Parts must be uniqueReduction
- A J K common ltbgt B.
- J ltbgt C. K .
- Flattened
- A J K.
- J ltbgt C ltbgt B. K ltbgt B.
6Add additional task 6 Flatten
- Test case
- A J K common ltbgt B.
- J ltbgt C. K .
- Flattened
- A J K.
- J ltbgt C ltbgt B. K ltbgt B.
7Is Flatten useful elsewhere?
- Test case
- A J K common ltbgt B.
- J ltb1gt C. K String.
- Flattened
- A J K.
- J ltb1gt C ltbgt B. K String ltbgt B.
8Is Flatten useful elsewhere?
- Test case
- A J K common ltbgt B.
- J ltbgt C. K String.
- Flattened
- A J K.
- J ltbgt C ltbgt B. K String ltbgt B.
Terminal Buffer Rule
9Parts must be unique
- Delay flatten implementation and assume input is
flat. We want to get a program running soon. - Phase 1 Implement Parts must be unique (PU)
for flat class graphs with construction and
alternation nodes and edges.
10Parts must be unique
- Which problem must be solved?
- Find duplicates in a Java list. Search on
google.com brought me to a book by John Zukowski
Mastering Java. He is a Northeastern CCS
undergraduate alumnus. He describes that the set
interface eliminates duplicates. His book is
featured on the SUN site.
11Parts must be unique
- Proposal add all the label elements of a class
definition to a set and check if the set already
contains each element. If so, have a violation. - Need an efficient imlementation of a set
HashSet offers constant time performance for add
and contains.
12Some useful code
- Set partNames new HashSet()
- partNames.contains(aName)
- partNames.add(aName)
13Design for computing flattened class graph
- compute_parts(TraversalGraph CA)
- for each concrete class
- find list of super classes
- append parts of super classes to immediate parts
- eliminate all parts from abstract classes.
14Finding Superclasses
- add auxiliary edges to class graph.
- set them with one traversal.
15Context Switch
16Context switch
- Multi-layer architecture similar to Demeters
architecture.
17UML language architecture
- UML metamodel defines meaning of UML models
- Defined in a metacircular manner, using a subset
of UML to specify itself - UML metamodel bootstraps itself. Similar
- compiler compiles itself
- grammar defines itself
- class dictionary defines itself
184 layer metamodel architecture
- UML metamodel one of the layers
- Why four layers?
- Proven architecture for complex models
- Validates core constructs by using them to define
themselves
19Four layer architecture
- meta-metamodel
- language for specifying metamodels
- metamodel
- language for specifying models
- model
- language for specifying objects in some domain
- user objects
20Four levels
- User Objects in running system
- check run-time constraints
- Model of System under design
- specify run-time constraints
- Meta-model
- specify constraints on use of constructs in model
- Meta-metamodel
- data interchange between modeling tools
21Three 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
objects
a class dictionary for class dictionaries
TL
class dictionary
text
TP
sentence
22Icon
Demeter Tiling
Use as reminder for Demeter Tiling.
CB OB CL TB OL
TL OP TP
23Example
???
Demeter Tiling
CB OB CL TB OL
TL OP TP
Basket
aBasketBasket
With respect to the project class dictionary as
OB
24Example
Vertex (or Ident)
Demeter Tiling
CB OB CL TB OL
TL OP TP
Basket
aBasketBasket
With respect to the project class dictionary as
OB
25Example
???
Demeter Tiling
CB OB CL TB OL
TL OP TP
Regular_Syntax
aRegular_SyntaxRegular_Syntax
With respect to the project class dictionary as
OB OL
26Example
Vertex
Demeter Tiling
CB OB CL TB OL
TL OP TP
Regular_Syntax
aRegular_SyntaxRegular_Syntax
With respect to the project class dictionary as
OB OL
27Example
???
Demeter Tiling
CB OB CL TB OL
TL OP TP
Labeled ltlabel_namegt Ident ...
ltbgt
With respect to the project class dictionary as
OB OL
28Example
Adjacency ltsourcegt Vertex ...
Demeter Tiling
CB OB CL TB OL
TL OP TP
Labeled ltlabel_namegt Ident ...
ltbgt
With respect to the project class dictionary as
OB OL
29Example
???
Demeter Tiling
CB OB CL TB OL
TL OP TP
Adjacency ltsourcegt Vertex ...
A ltbgt B ltbgt B.
With respect to the project class dictionary
30Example
Adjacency ltsourcegt Vertex ...
Demeter Tiling
CB OB CL TB OL
TL OP TP
Adjacency ltsourcegt Vertex ...
A ltbgt B ltbgt B.
With respect to the project class dictionary
31Buffer Rules
- Many problems of software engineering can be
solved by another layer of indirection.