grim/purple-objects-docbook

Parents c1781792d7c2
Children 281ed8ee506f
Added a lot of description to the graphs page including and example class as well as an example enum.
--- a/Makefile Thu Apr 30 22:43:53 2009 -0500
+++ b/Makefile Thu Apr 30 23:04:35 2009 -0500
@@ -42,11 +42,13 @@
graphs/whiteboards.hierarchy
CLASSES=\
+ graphs/example-class.class \
graphs/plugin.class \
graphs/plugin-info.class \
graphs/plugin-loader.class
ENUMS=\
+ graphs/example-enum.enum \
graphs/plugin-state.enum
KEYS=\
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphs/example-class.class Thu Apr 30 23:04:35 2009 -0500
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<class name="ExampleClass" type="abstract">
+ <properties>
+ <property name="foo" type="int" scope="private"/>
+ </properties>
+ <methods>
+ <method name="bar" type="int" scope="public">
+ <argument name="object" type="ExampleClass *"/>
+ </method>
+ </methods>
+</class>
+
+<!--
+ vi: syntax=xml
+-->
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphs/example-enum.enum Thu Apr 30 23:04:35 2009 -0500
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<enumeration name="ExampleEnum">
+ <item name="FOO" value="-1"/>
+ <item name="BAR" value="0"/>
+ <item name="BAZ"/>
+</enumeration>
--- a/xml/graphs.xml Thu Apr 30 22:43:53 2009 -0500
+++ b/xml/graphs.xml Thu Apr 30 23:04:35 2009 -0500
@@ -2,39 +2,106 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<chapter id="graphs">
- <title>About the graphs</title>
+ <title>Graphs</title>
<para>
There are many graphs in use in this document. All of the graphs
are generated by the tools in the graphviz package.
</para>
- <para>
- All object and interfaces are represented by a rectangle. The color is
- used to describe the type of object. We see that In
- <xref linkend="key-objects"/> abstract classes are pale green, concrete
- classes are light pink, and interfaces are powder blue.
- </para>
+ <simplesect id="graph-objects">
+ <title>Objects</title>
+
+ <para>
+ All object and interfaces are represented by a rectangle. The color is
+ used to describe the type of object. We see that In
+ <xref linkend="key-objects"/> abstract classes are pale green, concrete
+ classes are light pink, and interfaces are powder blue.
+ </para>
+
+ <figure id="key-objects">
+ <title>Object Key</title>
+
+ <graphic fileref="graphs/objects.png"/>
+ </figure>
+ </simplesect>
- <figure id="key-objects">
- <title>Object Key</title>
+ <simplesect id="graph-relationships">
+ <title>Relationships</title>
+ <para>
+ Similar to the object key, the <xref linkend="key-relationships"/>
+ shows how objects relate to one another. Subclasses point to their
+ parent class with an open arrow. Classes that implement interfaces
+ point to the interface they're implementing with an open circle.
+ Classes that have an instance of another class, are pointed to by that
+ class with an open diamond.
+ </para>
- <graphic fileref="graphs/objects.png"/>
- </figure>
+ <figure id="key-relationships">
+ <title>Relationship Key</title>
+
+ <graphic fileref="graphs/relationships.png"/>
+ </figure>
+ </simplesect>
+
+ <simplesect id="sect-class">
+ <title>Classes</title>
- <para>
- Similar to the object key, the <xref linkend="key-relationships"/>
- shows how objects relate to one another. Subclasses point to their
- parent class with an open arrow. Classes that implement interfaces
- point to the interface they're implementing with an open circle.
- Classes that have an instance of another class, are pointed to by that
- class with an open diamond.
- </para>
+ <para>
+ Classes are represented as a UML object as seen in
+ <xref linkend="figure-class"/>. The class name is the first line
+ in the top section, and is followed by any modifiers (abstract,
+ concrete, boxed, etc).
+ </para>
+
+ <para>
+ The second section contains the object's member variables. They
+ are prefixed with a '-' meaning they're private or '+' meaning
+ they're public. If a scope is not defined, there will be neither
+ prefix for the member variable. The rest of each member variable
+ is a 'name : type' pair, describing the member variable name and
+ it's type.
+ </para>
+
+ <para>
+ The final section contains all of the methods for the class. The
+ methods, like the member variables, have the typical scope prefixes.
+ Following the prefix is the name of the method. Next, is a list of
+ arguments to the method in the same 'name : type' pair format,
+ which are encapsulated in parenthesis. After the arguments, is the
+ final ': type', which is the return type of the method.
+ </para>
+
+ <figure id="figure-class">
+ <title>ExampleClass</title>
- <figure id="key-relationships">
- <title>Relationship Key</title>
+ <graphic fileref="graphs/example-class.png"/>
+ </figure>
+ </simplesect>
+
+ <simplesect id="sect-enums">
+ <title>Enumerations</title>
+
+ <para>
+ Enumerations are presented similarly to class. In
+ <xref linkend="example-enum"/>.
+ </para>
- <graphic fileref="graphs/relationships.png"/>
- </figure>
+ <para>
+ In the top section we see the name of the enumeration, followed by
+ a stereotype defining it as an enumeration.
+ </para>
+
+ <para>
+ The bottom section defines the names, and if given, the value of
+ the enumeration item in the typical 'name : value' format.
+ </para>
+
+ <figure id="example-enum">
+ <title>ExampleEnum</title>
+
+ <graphic fileref="graphs/example-enum.png"/>
+ </figure>
+ </simplesect>
</chapter>