The power of patterns in the design of object-oriented software is widely acknowledged in the software development community. This page demonstrates the power of the patterns approach in developing Complex Systems software. The aim is to provoke appreciation of the power of using patterns in a software design setting, with application to other Complex Systems modeling tasks (e.g., algorithm choice, population paradigm, etc.) being readily apparent.
Problem: To understand the behaviour of Boolean network models generated randomly, by design, and from an abstract genome model.
Proposed Solution: Use a collection of appropriate Complex Systems visualization patterns to understand the structure, dynamics and state space of the networks. Ideally, each visualization will reflect the current state of the model, and allow changes to the model's state through its unique view of the system. Network Diagram, Activation Diagram, and Hypercube Diagram are Complex Systems visualization patterns that offer views into the structure, dynamics and state space of the model respectively.
Designing the Solution
A commonly-known software engineering solution for this scenario is the Model-View-Controller (MVC) set of classes. The Model is the main object, the View presents the relevant Model information to the user, and the Controller facilitates user input. The MVC design can be defined in terms of more general software design patterns. Section 1.2 of [1] (page 4) offers the Observer, Composite, and Strategy design patterns as ways of implementing the relationships in MVC.
To implement our proposed solution, we chose the Strategy and Observer
patterns.
The Strategy Pattern
For details of the Strategy pattern, see [1] page 315.
The Strategy pattern encapsulates related algorithms, allowing them
to be interchangeable without altering the surrounding code, and
allowing future algorithms to be easily incorporated. Tailoring
the Strategy pattern to fit our scenario, the design of
the model-generating algorithms are as follows:
The Observer Pattern
For details of the Observer pattern, see [1] page 293.
The Observer pattern defines relationships between objects so that
consistency is maintained between them. The primary objects in this
pattern are the subject and the observer, where a subject can have
any number of observers. Observers are notified whenever the
subject's state changes, and subsequently update themselves by
querying the subject's state. This fits nicely with our proposed
solution, where we want a number of visualizations to be synchronized
with a single network model, and may wish to include new visualizations
in the future without changing existing code.
Tailoring the Observer pattern to fit our scenario, the design of
Model and Visualizations is as follows:
Tying it all together
For our final design, an interface will initially presented that allows the
user to choose a Strategy to generate a BooleanModel. Once the model is
created, a ModelUI is created, and attached to the Model. The ModelUI allows
the visualizations NetworkObserver, ActivationObserver, and Hypercube Observer
to be attached to its model. Each of these Observers allows user input to
request the model to change the state of a particular network node at a
particular time, which causes all Observers to be notified of the change.
Solution Implementation
The solution is written in C#, and requires .NET 1.1 and DirectX 9.0c
(with the October 2005 managed extensions). If you have these
prerequisites, you just need the
smaller installer (222KB). Otherwise, you will need to download the
larger installer (34.0MB), which includes the dependencies.
The prototype is still in development (i.e., not all exception handling is
implemented, etc.), so email
for the latest version of the source code or to ask questions / offer suggestions.




References
[1] Gamma, E., Helm, R., Johnson, R., and Vlissides, J. (1995).
Design Patterns: Elements of Reusable Object-Oriented Software.
Addison Wesley.
