| 75 |
|
|
| 76 |
|
Design patterns are optimal solutions to commonly-occurring problems |
| 77 |
|
in software design. Although they originated as an architectural |
| 78 |
< |
concept for buildings and towns by Christopher Alexander |
| 79 |
< |
\cite{Alexander1987}, design patterns first became popular in |
| 80 |
< |
software engineering with the wide acceptance of the book, Design |
| 81 |
< |
Patterns: Elements of Reusable Object-Oriented Software |
| 82 |
< |
\cite{Gamma1994}. Patterns reflect the experience, knowledge and |
| 83 |
< |
insights of developers who have successfully used these patterns in |
| 84 |
< |
their own work. Patterns are reusable. They provide a ready-made |
| 78 |
> |
concept for buildings and towns by Christopher |
| 79 |
> |
Alexander,\cite{Alexander1987} design patterns first became popular |
| 80 |
> |
in software engineering with the wide acceptance of the book, Design |
| 81 |
> |
Patterns: Elements of Reusable Object-Oriented |
| 82 |
> |
Software.\cite{Gamma1994} Patterns reflect the experience, knowledge |
| 83 |
> |
and insights of developers who have successfully used these patterns |
| 84 |
> |
in their own work. Patterns are reusable. They provide a ready-made |
| 85 |
|
solution that can be adapted to different problems as necessary. As |
| 86 |
|
one of the latest advanced techniques to emerge from object-oriented |
| 87 |
|
community, design patterns were applied in some of the modern |
| 88 |
|
scientific software applications, such as JMol, {\sc |
| 89 |
< |
OOPSE}\cite{Meineke2005} and PROTOMOL\cite{Matthey2004}. |
| 90 |
< |
The following sections enumerates some of the patterns |
| 91 |
< |
used in {\sc OOPSE}. |
| 89 |
> |
OOPSE}\cite{Meineke2005} and PROTOMOL\cite{Matthey2004}. The |
| 90 |
> |
following sections enumerates some of the patterns used in {\sc |
| 91 |
> |
OOPSE}. |
| 92 |
|
|
| 93 |
|
\subsection{\label{appendixSection:singleton}Singletons} |
| 94 |
|
|
| 133 |
|
structure of a Visitor pattern which is used extensively in {\tt |
| 134 |
|
Dump2XYZ}. In order to convert an OOPSE dump file, a series of |
| 135 |
|
distinct operations are performed on different StuntDoubles (See the |
| 136 |
< |
class hierarchy in Fig.~\ref{oopseFig:hierarchy} and the |
| 137 |
< |
declaration in Scheme.~\ref{appendixScheme:element}). Since the |
| 138 |
< |
hierarchies remain stable, it is easy to define a visit operation |
| 139 |
< |
(see Scheme.~\ref{appendixScheme:visitor}) for each class of |
| 140 |
< |
StuntDouble. Note that by using the Composite |
| 141 |
< |
pattern\cite{Gamma1994}, CompositeVisitor manages a priority visitor |
| 142 |
< |
list and handles the execution of every visitor in the priority list |
| 143 |
< |
on different StuntDoubles. |
| 136 |
> |
class hierarchy in Fig.~\ref{oopseFig:hierarchy} and the declaration |
| 137 |
> |
in Scheme.~\ref{appendixScheme:element}). Since the hierarchies |
| 138 |
> |
remain stable, it is easy to define a visit operation (see |
| 139 |
> |
Scheme.~\ref{appendixScheme:visitor}) for each class of StuntDouble. |
| 140 |
> |
Note that by using the Composite pattern,\cite{Gamma1994} |
| 141 |
> |
CompositeVisitor manages a priority visitor list and handles the |
| 142 |
> |
execution of every visitor in the priority list on different |
| 143 |
> |
StuntDoubles. |
| 144 |
|
|
| 145 |
|
\begin{figure} |
| 146 |
|
\centering |
| 668 |
|
|
| 669 |
|
{\tt Dump2XYZ} can transform an OOPSE dump file into a xyz file |
| 670 |
|
which can be opened by other molecular dynamics viewers such as Jmol |
| 671 |
< |
and VMD\cite{Humphrey1996}. The options available for Dump2XYZ are |
| 671 |
> |
and VMD.\cite{Humphrey1996} The options available for Dump2XYZ are |
| 672 |
|
as follows: |
| 673 |
|
|
| 674 |
|
\begin{longtable}[c]{|EFG|} |