Skip to content

Commit

Permalink
add diagrams to illustrate the loading patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Hellmann committed Jul 22, 2012
1 parent 5b6f241 commit a2887fd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Expand Up @@ -26,7 +26,7 @@


# Add any Sphinx extension module names here, as strings. They can be extensions # Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo'] extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.graphviz']


# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
Expand Down
36 changes: 36 additions & 0 deletions docs/source/loading.rst
Expand Up @@ -24,6 +24,18 @@ application, but it is implied in the interface between the
application and the driver that only one driver will be used to manage application and the driver that only one driver will be used to manage
a given resource. a given resource.


.. graphviz::

digraph drivers {
app [label="namespace",shape="record"];
d1 [style=filled,color=".7 .3 1.0",label="driver 1"];
d2 [style=dotted,label="driver 2"];
d3 [style=dotted,label="driver 3"];
app -> d1;
app -> d2 [style=dotted];
app -> d3 [style=dotted];
}

Examples of the *drivers* pattern include: Examples of the *drivers* pattern include:


* database client libraries used by SQLAlchemy_ * database client libraries used by SQLAlchemy_
Expand All @@ -44,6 +56,18 @@ a different name for the triggered event (e.g., ``startup`` and
the namespace, so that multiple hooks can be invoked when an event the namespace, so that multiple hooks can be invoked when an event
occurs. occurs.


.. graphviz::

digraph drivers {
app [label="namespace::event_name",shape="record"];
l1 [style=filled,color=".7 .3 1.0",label="event_name (lib1)"];
l2 [style=filled,color=".7 .3 1.0",label="event_name (lib2)"];
l3 [style=filled,color=".7 .3 1.0",label="event_name (lib3)"];
app -> l1;
app -> l2;
app -> l3;
}

Examples of the *hooks* pattern include: Examples of the *hooks* pattern include:


* Emacs `mode hook functions`_ * Emacs `mode hook functions`_
Expand All @@ -63,6 +87,18 @@ to be notified that they have been loaded and are being used so they
can perform initialization or setup steps. An extension may replace can perform initialization or setup steps. An extension may replace
core functionality or add to it. core functionality or add to it.


.. graphviz::

digraph drivers {
app [label="application",shape="record"];
e1 [style=filled,color=".7 .3 1.0",label="extension 1"];
e2 [style=filled,color=".7 .3 1.0",label="extension 2"];
e3 [style=filled,color=".7 .3 1.0",label="extension 3"];
app -> e1;
app -> e2;
app -> e3;
}

Examples of the *extensions* pattern include: Examples of the *extensions* pattern include:


* `Django apps`_ * `Django apps`_
Expand Down

0 comments on commit a2887fd

Please sign in to comment.