Documentation for Class Dictioinary in 2nd Use Case
I. Textual Class Dictionary with Grammars.
II. Modification to UseCase1
1. Two edges connect Vertex from Edge, which are from and to,
No edge connection between ConEdge and Vertex, AltEdge and AltVertex now,
TclTk will handle the syntax problem for class dictionary;
2. Alternation class Vertex has one more alternation class -- Term,
to support terminal class;
3. Edge has an optional part, which is a Coordinates object -- middlepoint,
in order to support bending point for drawing edges;
4. The content of Coordiantes has been changes from 2 DemNumber objects
to 1 DemString object -- coords;
5. Construction edge between VertexName and Coordinates has been changed
to optional, making the cd grammar simpler.
III. Design Patterns Used in 2nd Use Case
Adapter -- Convert the interface of a class into anther
interface clients expect, lets classes work together
that couldn't otherwise because of incompatible
interfaces.
Example: Edge : AltEdge | ConstEdge
*common*
"from" < from > Vertex
[ "Bendpoints" < middlepoints > Coordinates ]
"to" < to > Vertex .
// ConstEdge is the subclass of Edge
ConstEdge = "ConstEdge"
< edgename > EdgeName .
// Adapt the Edge's interface to EdgeName
by some PPs, such as cppDrawEdges
Facade -- Provide a unified interface to aa set of interfaces
in a subsystem, defines a higher level interface that
makes the subsystem easier to use.
Example: // 5 different subsystems
(1)Graph = <edges> Edge_List
<vertices> Vertex_List.
(2)ConstEdge = <edgename> EdgeName.
(3)EdgeName = <name> DemIdent
<e_position> Coordinates.
(4)Coordinates = <coords> DemString.
(5)VertexName = <name> DemIdent
[<vn_position> Coordinates].
Interpreter -- Given a language, define a represention for
its grammar along with an interpreter that uses the
representation to interpret sentences in the language.
Example: the cd.cd provided by pp group
Iterator -- Provide a way to access the elements of an
aggregate object sequentially without exposing its
underlying representation.
Example:
//list of edges
Edge_List ~ Edge { Edge }.
//list of vertices
Vertex_List ~ Vertex { Vertex }.