grim/purple-objects-docbook

4608408a1f6f
Parents 4db72ca102ec
Children 3d85aaf3ca93
Documented how has-a relationships will be shown
--- a/graphs.xml Fri Apr 17 20:03:05 2009 -0500
+++ b/graphs.xml Fri Apr 17 20:17:43 2009 -0500
@@ -38,11 +38,12 @@
<para>
Similar to the object key, the relationship key shows how
- objects relate to one another. Subclasses, expressed here as
- concrete classes, will point to their parent class with a solid
- line with a solid arrow. Classes that implement interfaces
- point to the interface they're implementing with a dotted line
- with an open circle.
+ objects relate to one another. Subclasses point to their
+ parent class with a solid line with an open arrow. Classes
+ that implement interfaces point to the interface they're
+ implementing with a dotted line with an open circle. Classes
+ that have an instance of another class, are pointed to by that
+ class with an open diamond.
</para>
</refsect2>
</refsect1>
--- a/relationship-key.dot Fri Apr 17 20:03:05 2009 -0500
+++ b/relationship-key.dot Fri Apr 17 20:17:43 2009 -0500
@@ -9,17 +9,26 @@
rankdir="lr";
node[fontname="sans", fontsize="9", style="filled", shape="rect"];
-
+
+ /* is-a (inheritance) */
+ abstract[label="Abstract Class", color="palegreen"];
+ class1[label="Class", color="lightpink"];
+
+ edge[style="solid", arrowhead="onormal"];
+ class1 -> abstract;
+
+ /* is-a (interfaces) */
interface[label="Interface", color="powderblue"];
implementor[label="Implementor", color="lightpink"];
edge[style="dotted", arrowhead="odot"];
implementor -> interface;
- abstract[label="Abstract Class", color="palegreen"];
- concrete[label="Concrete Class", color="lightpink"];
+ /* has-a */
+ class2[label="Class", color="lightpink"];
+ has_a[label="Has a", color="lightpink"];
- edge[style="solid", arrowhead="normal"];
- concrete -> abstract;
+ edge[style="solid", arrowhead="odiamond"];
+ class2 -> has_a;
}