    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: User Defined Types: Qualities, Principles and
Archetypes.</title>
        <link>https://members.accu.org/index.php/articles/477</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>




<div class="xar-mod-head"><span class="xar-mod-title">Programming Topics + Overload Journal #39 - Sep 2000</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c13/">Topics</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c65/">Programming</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c78/">Overload</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c165/">39</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/c65-165/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/articles/c65+165/">All of these categories</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;User Defined Types: Qualities, Principles and
Archetypes.</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 26 September 2000 17:50:58 +01:00 or Tue, 26 September 2000 17:50:58 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e18" id="d0e18"></a></h2>
</div>
<p>When designing something, we make a careful study of the
situation/business (domain analysis). Sometimes the business is so
broad that it's best split up into smaller areas. I prefer to split
the business focus into <span class=
"bold"><b>sub-domains</b></span> (e.g. forecasting, risk-analysis)
and the technology into <span class=
"bold"><b>sub-systems</b></span> (e.g. databases, GUIs).</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e28" id="d0e28"></a>Divide and
Rule.</h2>
</div>
<p>One way to broadly partition a system is to divide it into its
<span class="bold"><b>application domain(s)</b></span> (which deals
with elements relevant to the application / business domains) and
its <span class="bold"><b>solution domain</b></span> (programming
language and design patterns used) [See <a href="#MPD">MPD</a> and
<a href="#GENPROG">GENPROG</a> for more details on Domains].</p>
<p>Ultimately the system will be implemented as <span class=
"bold"><b>software elements</b></span>: source modules, functions,
classes, templates and DLLs etc. Even when using a technique like
divide and conquer, things can get confusingly interwoven very
quickly.</p>
<p>One simple solution is to note everything on <span class=
"bold"><b>Class Responsibility Cards</b></span> (CRCs).</p>
<div class="informaltable">
<table border="1" cellspacing="0">
&lt;colgroup&gt;
&lt;col&gt;
&lt;col&gt;&lt;/colgroup&gt;
&lt;tbody&gt;
<tr valign="top">
<td valign="top">
<div class="literallayout">
<p><span class="bold"><b>Class:</b></span> Singular nouns make the
best  <br>
            class names.</p>
</div>
</td>
<td rowspan="2" valign="top">
<div class="literallayout">
<p><span class="bold"><b>Collaborators</b></span><br>
    Other classes<br>
    Interaction between a client &amp; a server</p>
</div>
</td>
</tr>
<tr valign="top">
<td valign="top">
<div class="literallayout">
<p><span class="bold"><b>Responsibility:</b></span><br>
    What the class represents.<br>
    What the class does.<br>
    Services the class provides<br>
    as a server.</p>
</div>
</td>
</tr>
&lt;/tbody&gt;
</table>
</div>
<p>Paraphrasing a <i class="citetitle">C++ Report</i> (Sept '91)
article on CRCs:</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>Goal of the CRC process is a collection of cards that:</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>Are an informally documented set of abstractions for classes
that could be applied to the problem being studied.</p>
</li>
<li>
<p>Improve the participant's understanding &amp; confidence in how
an object-oriented architecture might be applied to problems in the
domain being studied / analysed.</p>
</li>
</ol>
</div>
</blockquote>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e90" id="d0e90"></a>The CRC
process.</h2>
</div>
<div class="orderedlist">
<ol type="1">
<li>
<p>Identify candidate classes by identifying singular nouns &amp;
putting them on CRC cards.</p>
</li>
<li>
<p>Add some responsibilities (some arise from the nature of the
class, some from the systems input/output or pre/post condition
requirements.</p>
</li>
<li>
<p>Simulate the behaviour of the system using your CRC cards in
walkthroughs. New classes will be added. Old classes will be
dropped/modified. The walkthroughs continue until the CRC cards
stabilise. If they don't stabilise, the designers have some
misconception(s) about the problem domain or requirements.</p>
</li>
<li>
<p>Do more walkthroughs but consider the system's exceptions. Need
to be careful you don't design beyond the scope of the system.</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Classes with no responsibilities should be removed.</p>
</li>
<li>
<p>Classes with only one responsibility may be best removed (&amp;
that responsibility placed in another class).</p>
</li>
<li>
<p>A full card is a candidate for breaking into two or more classes
that divide responsibilities.</p>
</li>
</ul>
</div>
</li>
</ol>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e116" id="d0e116"></a>Inheritance and
CRC cards.</h3>
</div>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Sometimes inheritance will be obvious - set the cards out as a
hierarchy.</p>
</li>
<li>
<p>When variation within the hierarchy is not significant for a
scenario, all the derived-class cards can be hidden under the base
class card.</p>
</li>
<li>
<p>It might emerge only after the designers recognise similarities
in the responsibilities of a set of classes.</p>
</li>
<li>
<p>See the Liskov Substitutability Principle further on in this
article.</p>
</li>
</ul>
</div>
<p>With CRCs, you end up with a collection of cards in which you've
split your system into classes, given meaningful names to the
classes, decided what individual classes do and how the classes
interact. These CRCs can be presented and updated at key meetings
between stakeholders (key system architects, designers,
customers).</p>
<p>CRCs are very flexible - but taken literally they will bias /
restrict us to an Object Oriented solution. A more balanced
approach is to adapt CRCs to identify other software elements (e.g.
standalone functions - algorithms) as well. When do you use a class
(member function) and when do you use a free standing function? See
&quot;<i class="citetitle">Intuitive Multi-Paradigm Design : Do I use a
member function or a non-member function</i>&quot; [Bruntlett, Overload
38] for further discussion on this.</p>
<p>If CRCs aren't sufficient, supplement them with other, more
formal, models for:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Structure (static model).</p>
</li>
<li>
<p>Behaviour (dynamic model).</p>
</li>
</ul>
</div>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e148" id="d0e148"></a>Finding
classes.</h3>
</div>
<p>I ask the question &quot;if the domain had a language, what would its
built-in (fundamental) types be?&quot; This identifies my <span class=
"bold"><b>fundamental / value types</b></span>. They tend to be
written to:</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>complement the existing built-in types for a clearer solution
or</p>
</li>
<li>
<p>implement built-in types fundamental / native to the application
domain(s).</p>
</li>
</ol>
</div>
<p>For further discussion see [<a href="#SUB">SUB</a>], the CHECKS
(Whole-Value) and STARS pattern languages [<a href=
"#PLOP">PLOP</a>] and QUANTITY [<a href="#ANAPAT">ANAPAT</a>].</p>
<p>I also ask &quot;if the domain were a play, what would the characters
be?&quot; This identifies my <span class="bold"><b>entities</b></span> -
they each have a set of goals (agenda) and they instigate actions
to meet those ends, collaborating with other characters. Entities
have significant identity and are typically represented using an
instance of a Whole-Part class.</p>
<p>A user-defined type is one of:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>A class.</p>
</li>
<li>
<p>An <span class="bold"><b>enumeration</b></span> of a set of
numeric constants.</p>
</li>
</ul>
</div>
<p>A class is written to implement:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>A <span class="bold"><b>represention</b></span> of something
found in an area of interest (domain).</p>
</li>
<li>
<p>A <span class="bold"><b>mechanism</b></span> for manipulating
other types.</p>
</li>
</ul>
</div>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e206" id="d0e206"></a>Class as
mechanism.</h3>
</div>
<p>A mechanism class is used to manipulate objects (and, in some
cases, types) as part of the solution. Case studies of common O.O.
mechanisms (<i class="firstterm">Abstract Factory</i>, <i class=
"firstterm">Proxy</i> etc) have been documented as design patterns,
expanding the solution domain, implementing one or more
predetermined conventional <span class=
"emphasis"><em>interfaces</em></span>.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e220" id="d0e220"></a>Class as
representation.</h3>
</div>
<p>A class represents something. Whether that thing is a value or
entity depends on the viewer / manipulator's perspective. It may in
be implemented in terms of other classes (Whole-Part). Its
qualities of analysis, design and implementation are judged
according to the qualities of abstract/concrete, granularity
(sufficiency) and collaborations (DIP, LSP, OCP).</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e225" id="d0e225"></a>Type properties
: Identity, State, Behaviour.</h3>
</div>
<p>An object (instance of a type) lies somewhere along three axes
of identity, state and behaviour [<a href="#OOADWA">OOADWA</a>].
Each different kind of UDT can be placed on these axes. This may
help point out similarities &amp; differences (commonalities &amp;
variabilities) between them.</p>
<p>In <span class="bold"><b>value based programming</b></span>, a
value has no significant identity (it has transparent identity) -
for instance, neither 15 Kilowatt hours nor the colour green have
significant identity. You're only interested in its state and
behaviour.</p>
<p>STL containers are an example of value based programming. For
instance (by default) <tt class=
"methodname">vector&lt;&gt;::resize()</tt> invokes the default
constructor to create objects when the <tt class=
"classname">vector</tt> is created and invokes the copy constructor
when moving a <tt class="classname">vector</tt> in memory after it
has been resized.</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>&quot;Value types do not tend to live in class hierarchies, although
they may well live in shallow type hierarchies (classified by
conversions, operator overloading, mutability and templates)&quot; [KH -
Kevlin Henney].</p>
</blockquote>
</div>
<p>Strong typing in a system enforces a type's domain-specific
rules avoiding absurd situations where sunset time is added to
energy in KWh. Overly strong type-checking traps the developer in a
straitjacket.</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>&quot;A distinction between value and exception types is that
although they seem similar at first sight, the consequences are
different. For instance, identity is transparent for both, and
behaviour is unsophisticated (i.e. just at the wrapper level).
However, values are stateful whereas exceptions may or may not be
stateful, and exceptions tend to live in class hierarchies. That is
a classification view, and in terms of consequences we see this in
the fact that although exception classes in C++ require copy ctors,
they do not require assignment operators (in fact, these are a bad
idea)</p>
<p>There are other consequences, but this gives a reasonable
starting point in understanding how something is used affects how
it is built, and so that by understanding the nature of the object
(identity, etc) and naming this, we can tie together language
features into a more meaningful description than a shopping list.
Voil&agrave;, patterns.&quot; [KH].</p>
</blockquote>
</div>
<div class="blockquote">
<blockquote class="blockquote">
<p>&quot;In addition &hellip; there's purpose, relationships,
creation/lifetime and movement &hellip; its possible to
over-classify beyond the point of usefulness or stability - you
don't really want objects hopping from type to type at the
slightest shift of design.&quot; [KH].</p>
</blockquote>
</div>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e262" id="d0e262"></a>Parameters :
Value or Reference semantics?</h3>
</div>
<p>In a function call, many objects can be passed by value (value
semantics) with little impact on the meaning of a program. It might
use more memory, it might take more time to run. If the object
isn't changed and it is larger than a pointer, passing it by const
reference uses less processor time and memory than passing it by
value.</p>
<p>With reference (indirection) semantics, objects are passed by
reference (indirectly, by pointer or a reference) instead of by
value. If a function must modify its parameters (i.e. have output
parameters), either a reference or pointer parameter can be
used.</p>
<p>Personally, I prefer using a pointer because the syntax is
different and highlights the potential data-flow to someone reading
the code. Others dislike this approach because a pointer can be
NULL and this implies that the output parameter is optional whereas
a reference parameter should never be and indicates the parameter
is mandatory.</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>&quot;There is another reason to favour references over pointers
which has little to with the null affordance: values represent
immediate as opposed to indirect content. Pointers emphasise
identity whereas by ref emphasises content. Also, operator
overloading is meaningful for value types but not reference types,
and this guideline is reinforced by the awkwardness of attempting
to use overloaded operators through a pointer.&quot; [KH]</p>
</blockquote>
</div>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e274" id="d0e274"></a>Type relations
&amp; interactions.</h3>
</div>
<p>At Kevlin Henney's JaCC lecture on substitutability [<a href=
"#SUB">SUB</a>], he revealed that &quot;<span class="quote"><span class=
"emphasis"><em>a type hierarchy defines a classification
relationship between types based on extension and
substitutability</em></span></span>&quot;. And that &quot;<span class=
"quote"><span class="emphasis"><em>vertical delegation moves
execution responsibility up and down a Class
hierarchy</em></span></span>&quot;. Moving on to the subject of object
interactions &quot;<span class="quote"><span class="emphasis"><em>An
Object Hierarchy expresses a structure over which horizontal
delegation acts, with significant objects cascading
responsibility</em></span>.</span>&quot;</p>
<p>It also brought to my attention the notion of a type heterarchy
- &quot;<span class="quote"><span class="emphasis"><em>where types can
be defined as readily convertible between each other&hellip; an
Object Heterarchy defines a set of object relationships where there
is no definite root</em></span></span>&quot;. Heterarchies can be
non-lossy - e.g. degrees and radians - or lossy - conversions
between the built-in numeric types.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e300" id="d0e300"></a>Types and
interface.</h3>
</div>
<p>So far I've been dealing with abstraction as a measure of a
type's independence from details. Just as everything is beginning
to settle down, I'd like to introduce another definition:</p>
<p>Abstraction can also be broken down as gathering things together
(aggregation) and putting a barrier around them (encapsulation)
through which interactions independent of implementation details
take place (interface).</p>
<p><span class="emphasis"><em><span class="bold"><b>When judging if
a UDT is abstract or concrete, we are evaluating its</b></span>
interface.</em></span></p>
<p><span class="emphasis"><em><span class="bold"><b>When judging
the sufficiency (granularity) of a UDT, we are evaluating
its</b></span> aggregation <span class="bold"><b>and</b></span>
encapsulation.</em></span></p>
<p>A <span class="emphasis"><em><span class=
"bold"><b>class</b></span></em></span> implements one or more
interfaces. Classes that implement the same type have something in
common. Those classes can be used interchangeably wherever their
common type/interface is used.</p>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e326" id=
"d0e326"></a>Qualities</h2>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e329" id="d0e329"></a>Abstraction</h3>
</div>
<p>Abstraction is a way to understand a complex thing - concentrate
on its significant aspects and ignore its less significant
details.</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>&quot;Abstraction is selective ignorance&quot; - Andrew Koenig.</p>
</blockquote>
</div>
<p>The degree of a user-defined type's abstraction can be placed
somewhere between two ends of a goldilocks scale - &quot;When is a type
concrete and when is it abstract?&quot;</p>
<p>A type is abstract if it is suitably independent of
implementation details. The end user can describe its use in terms
of the problem being solved (i.e. with little or no regard to
implementation details).</p>
<div class="informaltable">
<table border="1" cellspacing="0">
&lt;colgroup&gt;
&lt;col&gt;
&lt;col&gt;&lt;/colgroup&gt;
&lt;thead&gt;
<tr>
<th>Abstraction</th>
<th>Comment</th>
</tr>
&lt;/thead&gt;
&lt;tbody&gt;
<tr>
<td>Too hot</td>
<td>Too abstract to be usable. System has gaseous form &amp; is
hard to grasp.</td>
</tr>
<tr>
<td>Just right</td>
<td>Just right.</td>
</tr>
<tr>
<td>Too cold</td>
<td>Too detail-specific to be usable. &quot;Strict modeling of the real
world leads to a system that reflects today's realities but not
necessarily tomorrow's&quot; [<a href="#GoF">GoF</a>].</td>
</tr>
&lt;/tbody&gt;
</table>
</div>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e368" id="d0e368"></a>Abstract data
type.</h3>
</div>
<p>An <span class="bold"><b>abstract data type</b></span>
<span class="underline">hides</span> a certain level of
implementation details from the user. For <span class=
"underline">useful</span> abstract data types, the user wants to
<span class="underline">ignore</span> these details. The user
relies on the type's <span class="underline">interface</span> so
that it can ignore these details.</p>
<p>Good abstractions blur details that would stop us from seeing
the overall picture. If you blur the details too much, it becomes a
fog, preventing us from seeing anything, prompting Jim Coplien to
posit, &quot;Abstraction is evil&quot;.</p>
<p>If the problem being solved dictates that the only appropriate
methods for an abstract data type is a comprehensive list of
Set/Get methods, maybe its time to step back and ask, &quot;Am I being
too abstract here? Should I use a simple aggregate type?&quot;</p>
<p>If you consider that a class is written to solve a particular
problem, it is possible to classify member variables as one of:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p><span class="bold"><b>Application-specific</b></span> (something
the end user will be aware of and probably interested in).</p>
</li>
<li>
<p><span class="bold"><b>Solution-specific</b></span> (something
that can be removed in a different version of the class without the
user having to do anything different).</p>
</li>
</ul>
</div>
<p>An abstract data type may have a mixture of both
application-specific members and solution-specific members. A
<span class="bold"><b>simple aggregate type</b></span> should only
have public member variables.</p>
<p>Use of a simple aggregate type can be a symptom of insufficient
abstraction due to inadequate analysis or insufficient information.
Whatever the reason, we're being too concrete and should be
implementing an abstract data type.</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>&quot;Modelarity is the degree of correspondence between problem and
solution&quot; (Kevlin Henney)</p>
</blockquote>
</div>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e415" id="d0e415"></a>Concrete
type.</h3>
</div>
<p>A <span class="bold"><b>concrete type</b></span> <span class=
"underline">exposes</span> a certain level of implementation
details to the user. For <span class="underline">useful</span>
concrete data types, the user <span class=
"underline">expects</span> to know these details and is
<span class="underline">relying</span> on those details.</p>
<p>Good concrete types are something physically representing
details of the problem you are solving. Getting something written
and running is the focus - refactoring takes a back seat here. This
isn't all bad - the experience in writing a concrete type for a
problem is a good way to pick up the experience needed to write an
abstract data type for the problem later - and that will replace
the concrete type.</p>
<p>The lack of initial effort for concrete types can be quite
beguiling and you may find yourself wading through concrete data
types during development - just remember concrete eventually sets,
impeding progress somewhat. In the long term, concrete crumbles -
does this make concrete evil? No, just remember you build floors
not seven league boots out of concrete.</p>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e439" id=
"d0e439"></a>Principles.</h2>
</div>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Granularity (sufficiency)</p>
</li>
<li>
<p>Liskov Substitutability Principle</p>
</li>
<li>
<p>Open-Closed Principle</p>
</li>
</ul>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e452" id="d0e452"></a>Type granularity
(sufficiency).</h3>
</div>
<p>An abstraction viewed in isolation may appear to be correct. We
need to consider its <span class="bold"><b>granularity</b></span>,
<span class="bold"><b>substitutability</b></span> and <span class=
"bold"><b>dependencies</b></span> within the system(s) it will be
used. Granularity is one way to judge the quality of a
classification using the principles of loose coupling (low
interconnectedness) and high cohesion (intraconnectedness [<a href=
"#Design">Design</a>]). Is the classification too coarse (doing too
much, too large to be comprehended and should be split up). Or is
it too fine (doing too little, difficult to understand as there are
too many bits to comprehend - some of the bits should be merged
with others)?</p>
<div class="informaltable">
<table border="1" cellspacing="0">
&lt;colgroup&gt;
&lt;col&gt;
&lt;col&gt;&lt;/colgroup&gt;
&lt;thead&gt;
<tr>
<th>Granularity</th>
<th>Comment</th>
</tr>
&lt;/thead&gt;
&lt;tbody&gt;
<tr>
<td>Too course</td>
<td>Assumes too much responsibility</td>
</tr>
<tr>
<td>Just right</td>
<td>Weakly coupled. Highly cohesive.</td>
</tr>
<tr>
<td>Too fine</td>
<td>Too little. Shirks responsibility.</td>
</tr>
&lt;/tbody&gt;
</table>
</div>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e493" id="d0e493"></a>Type
substitutability - the LSP.</h3>
</div>
<p>Analysis may identify groups (families) of similar types used
interchangeably in similar circumstances. For example a system may
have a couple of database classes used interchangeably, depending
on what kind of database server is being accessed.</p>
<p>To paraphrase the <span class="emphasis"><em>Liskov
Substitutability Principle</em></span> [<a href="#LSP">LSP</a>] -
if a program can use objects of type S instead of objects of type T
without changing the behaviour of the program, then type S is a
subtype of type T. This applies to all sorts of polymorphism -
compile time [<a href="#SUB">SUB</a>] as well as runtime.</p>
<p>The <span class="emphasis"><em><span class="bold"><b>Open-Closed
Principle</b></span></em></span> was introduced by Bertrand Meyer
in his book &quot;Object-Oriented Software Construction&quot; (see [<a href=
"#OCP">OCP</a>] for more details). Bertrand Meyer states:</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>&quot;Software entities (Classes, Modules, Functions, etc.) should be
open for extension, but closed for modification.&quot;</p>
</blockquote>
</div>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e521" id="d0e521"></a>Type
dependencies - the DIP.</h3>
</div>
<p>The <span class="emphasis"><em>dependency inversion
principle</em></span> (DIP) is a set of guidelines used to judge
dependencies [<a href="#DIP">DIP</a>]:</p>
<p>High level modules should not depend on low-level modules. Both
should depend upon abstractions.</p>
<p>Abstractions should not depend on details. Details should depend
on abstractions.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e536" id="d0e536"></a>Context,
Principles, Good practice.</h3>
</div>
<p>Good practice / rules of thumb are specific to a context based
on factors including language, runtime environment, application
domain.</p>
<p>The language used (for example C vs C++) determines the
mechanisms available to implement abstractions. The additional
language support of C++ allows much more ambitious abstractions to
be implemented than in C. This has a cost, though - abstractions
implemented in C don't have to cater for the complications
(overloading, exceptions) of C++.</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>&quot;The appropriateness of an abstraction is often, somewhat
cyclically, dependent on the way that it is to be realised&quot; (Kevlin
Henney).</p>
</blockquote>
</div>
<p>Similar comparisons can be made with Java or the different
generations of C++.</p>
<p>Changing runtime environment (single tasking to multi-tasking,
standalone to network, single CPU to SMP, single-threading to
multi-threading) means certain idioms no longer work</p>
<p>Application domain and implementation organisation affects the
life cycle of the project - long term projects will want longer
lasting abstractions. According to Conway's Law [<a href=
"#PLOP">PLOP</a>], there is a relationship between an organisation
and the systems it produces - the structure of the organisation is
reflected in the architecture of the systems it produces and vice
versa.</p>
<p>Good practice often fails to survive radical paradigm shifts in
the same way that civilisations fail to handle Outside Context
Problems (<i class="citetitle">Excession</i>, Iain M. Banks).
Moving to a radically new context, previous good practice may be
inappropriate - context is a force that affects abstractions.
Principles, in their abstract form, are relative to the context.
Principles, when applied to a context become part of that context -
change the context and you have to rethink how the principle
applies to the new context.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e560" id="d0e560"></a>Archetypes.</h3>
</div>
<p>Labelling a UDT an 'abstract data type' or 'concrete data type'
is about as helpful as saying that a doughnut is a &quot;fresh doughnut&quot;
or a &quot;stale doughnut&quot;. It would be nice to know what <span class=
"emphasis"><em>kind</em></span> of doughnut you are dealing with
(jam, confectioner's custard, bubble gum etc). Similarly it would
be nice to be able to specify what <span class=
"emphasis"><em>kind</em></span> of UDT you are talking about
(aggregate, alias, meta, Whole-Part) and whether or not it is
intended for use as an entity, a value or both.</p>
<p>There are many ways to categorise types, here is a list I've
built up while writing this article: aggregate, alias, creation,
entity, exception, meta, resource / service, usage, fundamental /
value, whole-part.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e573" id="d0e573"></a>Evolution,
entropy, seasons.</h3>
</div>
<p>Systems have seasons during their life-cycle. A system in summer
has abstract data types that have evolved from concrete data types.
A system in winter has abstract data types that have decayed to
concrete data types.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e578" id="d0e578"></a>Brittle
interface = Brittle type.</h3>
</div>
<p>Something (e.g. a concrete type, abstract type, interface etc)
is brittle if it exposes overly implementation-specific details to
the user. This causes it to &quot;break&quot; when reasonable change
occurs.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e583" id="d0e583"></a>Concrete types
vs Alias types.</h3>
</div>
<p>Using the previous view of brittleness, a brittle concrete type
exposes too many implementation details to the user. For example,
in a particular application, a class may expect to handle
&quot;<tt class="varname">NoOfBooks</tt>&quot; as an integer of some kind,
currently a <tt class="type">short int</tt>.</p>
<p>Directly specifying &quot;<tt class="type">short int</tt>&quot; for any
<tt class="varname">NoOfBooks</tt> in the interface is brittle. All
it takes is a modest change in application requirements (dealing
with a lot more books) to trigger an awful lot of error-prone
editing. This has bitten me before so I try to avoid it. Currently,
any solution to this conundrum is a compromise.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e602" id="d0e602"></a>Concrete data
type (brittle interface).</h3>
</div>
<pre class="programlisting">
void DoIt (short int BkCount);
</pre>
<p>Disadvantages:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Brittle in the face of change. Some may disagree that change
will happen.</p>
</li>
</ul>
</div>
<p>Advantages:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Clarity. Some may disagree about this.</p>
</li>
</ul>
</div>
<p>If a built-in type does exactly what we want in an application,
why use an alias? Initially an alias is a little awkward - it is
more thinking for the developer to do. However, as soon as
something changes (for instance we decide to use an int instead of
a short int the alias type is easily updated to accommodate the
change.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e621" id="d0e621"></a>Aliased data
type (supple, up to a point).</h3>
</div>
<p>The simplest solution is to wrap it up as &quot;<tt class=
"literal">typedef short int NoOfBooks</tt>&quot;. This is an improvement
- <tt class="varname">NoOfBooks</tt> can now be changed by updating
a single <tt class="literal">typedef</tt> and recompiling
everything. That is supple enough for many uses.</p>
<p>A <span class="bold"><b>typedef is not a real UDT</b></span>, it
is only an alias for a type - this leads to problems with function
overloading. Consider this contrived example:</p>
<pre class="programlisting">
typedef short int NoOfBooks;
typedef short int NoOfScreens;
void DoIt (NoOfBooks BkCount); 
void DoIt (NoOfScreens ScrCount);
</pre>
<p>Problem. As far as function overloading is concerned, the two
functions are identical.</p>
<p>If overloaded functions are absolutely necessary, there is a
solution but it's not pretty.</p>
<p>Something like:</p>
<pre class="programlisting">
struct NoOfBooks
{
  unsigned int Value;
};
</pre>
<p>Disadvantages:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>May produce less optimum code.</p>
</li>
<li>
<p>Unusual syntax e.g <tt class="literal">Found.Value++</tt>
instead of <tt class="literal">Found++</tt>.</p>
</li>
<li>
<p>You can tie yourself up in knots if you overuse suppleness.</p>
</li>
<li>
<p>You have to think up a meaningful name. If you cannot think of
one, perhaps (1) you are being too abstract or (2) you have not
understood the domain.</p>
</li>
</ul>
</div>
<p>Advantages:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Supple</p>
</li>
<li>
<p>Function overloading can be used.</p>
</li>
<li>
<p>Your fundamental types can be placed in hierarchies.
Polymorphism and RTTI can be used. This sort of power demands
careful use.</p>
</li>
</ul>
</div>
<p>If an alias type isn't flexible enough, replace it with an
abstract data type.</p>
<div class="informaltable">
<table border="1" cellspacing="0">
&lt;colgroup&gt;
&lt;col&gt;
&lt;col&gt;&lt;/colgroup&gt;
&lt;tbody&gt;
<tr valign="top">
<td valign="top">
<div class="literallayout">
<p><span class="bold"><b>Class:</b></span> Alias</p>
</div>
</td>
<td rowspan="2" valign="top">
<div class="literallayout">
<p><span class="bold"><b>Collaborators</b></span><br>
    Aliasee</p>
</div>
</td>
</tr>
<tr valign="top">
<td valign="top">
<div class="literallayout">
<p><span class="bold"><b>Responsibility:</b></span><br>
    Allow another type (the aliasee)<br>
    to be referred to using another<br>
    name (the alias) </p>
</div>
</td>
</tr>
&lt;/tbody&gt;
</table>
</div>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e705" id="d0e705"></a>Aggregate
types.</h3>
</div>
<p>Collections of objects exist for various reasons.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e710" id="d0e710"></a>Library
aggregate types - STL containers.</h3>
</div>
<p>Although it is possible to use STL containers directly (e.g.
<tt class="classname">vector&lt;MyType&gt;</tt>), this is brittle
and in most cases a typedef should be used, for reasons already
discussed.</p>
<p>Brittle concrete use of containers:</p>
<pre class="programlisting">
typedef int CustomerCount;
void Profile::ApplyCustomerNumberForecast(
   const vector&lt;CustomerCount&gt;
                   &amp;rvCustomerCount,
   const vector&lt;TDate&gt;
               &amp;rvCustomerForecastDate,
   const size_t NoOfDates
);
</pre>
<p>Aliased use of containers:</p>
<pre class="programlisting">
typedef vector&lt;CustomerCount&gt; 
                  CustomerCountTable;
typedef vector&lt;TDate&gt; DateTable;

void Profile::ApplyCustomerNumberForecast(
   const CustomerCountTable
                 &amp;rCustomerCountTable,
   const DateTable
           &amp;rCustomerForecastDateTable,
   const size_t NoOfDates
);
</pre>
<p>If an alias type is insufficient, consider using a <span class=
"emphasis"><em>Whole-Part</em></span> type instead.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e731" id="d0e731"></a>Simple aggregate
types - struct/class.</h3>
</div>
<p>The C++ struct/class mechanism is usually used to implement
abstract data types. It can also be used as a very simple container
to hold abstract data types - by using it as a simple C-style
struct with all the data members public with no member
functions.</p>
<p>I sometimes regard simple aggregate types as <span class=
"emphasis"><em>bureaucratic data types</em></span> - they only
exist to push forms of data from one place to another, applying
arbitrary rules. Whatever the reasons for the type, I tend to
reconsider my analysis and wonder if I have allocated behaviour /
responsibility properly.</p>
<p>If an aggregate type is really justified, it worth considering
Coad &amp; Nicola's &quot;behaviour across a collection&quot; principle [from
their book Object Oriented Programming] &quot;<span class=
"quote"><span class="emphasis"><em>let a collection do just the
work that applies across a collection. Push work down into each
part.</em></span></span>&quot;</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e746" id="d0e746"></a>Encapsulated
Aggregation - Whole-Part</h3>
</div>
<p>Lots of UDTs are &quot;Whole-parts&quot;. Here is the definition:</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>&quot;The Whole-Part design pattern helps with the aggregation of
components that together form a semantic unit. An aggregate
component, the Whole, encapsulates its constituent components, the
Parts, organizes their collaboration, and provides a common
interface to its functionality. Direct access to the Parts is not
possible&quot; [<a href="#POSA">POSA</a>].</p>
</blockquote>
</div>
<div class="informaltable">
<table border="1" cellspacing="0">
&lt;colgroup&gt;
&lt;col&gt;
&lt;col&gt;&lt;/colgroup&gt;
&lt;tbody&gt;
<tr valign="top">
<td valign="top">
<div class="literallayout">
<p><span class="bold"><b>Class:</b></span> Whole</p>
</div>
</td>
<td rowspan="2" valign="top">
<div class="literallayout">
<p><span class="bold"><b>Collaborators</b></span><br>
    Part</p>
</div>
</td>
</tr>
<tr valign="top">
<td valign="top">
<div class="literallayout">
<p><span class="bold"><b>Responsibility:</b></span><br>
    Aggregates several smaller objects.<br>
    Provides services built on top of part<br>
    objects.<br>
    Acts as a wrapper around its constituent <br>
    parts.</p>
</div>
</td>
</tr>
&lt;/tbody&gt;
</table>
</div>
<div class="informaltable">
<table border="1" cellspacing="0">
&lt;colgroup&gt;
&lt;col&gt;
&lt;col&gt;&lt;/colgroup&gt;
&lt;tbody&gt;
<tr valign="top">
<td valign="top">
<div class="literallayout">
<p><span class="bold"><b>Class:</b></span> Part</p>
</div>
</td>
<td rowspan="2" valign="top">
<div class="literallayout">
<p><span class="bold"><b>Collaborators</b></span><br>
    Whole</p>
</div>
</td>
</tr>
<tr valign="top">
<td valign="top">
<div class="literallayout">
<p><span class="bold"><b>Responsibility:</b></span><br>
    Represents a particular object and its<br>
    services.</p>
</div>
</td>
</tr>
&lt;/tbody&gt;
</table>
</div>
<p>The <span class="emphasis"><em>Whole-Part</em></span> pattern in
POSA is well worth reading. It includes an implementation guide (p
231), which may clear a mental block or two. It describes three
variants - unfortunately some of their names clash with STL
terminology.</p>
<div class="informaltable">
<table border="1" cellspacing="0">
&lt;colgroup&gt;
&lt;col&gt;
&lt;col&gt;&lt;/colgroup&gt;
&lt;thead&gt;
<tr>
<th>STL friendly term</th>
<th>Original term</th>
</tr>
&lt;/thead&gt;
&lt;tbody&gt;
<tr>
<td>Assembly-Parts</td>
<td>Assembly-Parts</td>
</tr>
<tr>
<td>Bag-Contents</td>
<td>Container-Contents</td>
</tr>
<tr>
<td>Collection / Container - Part</td>
<td>Collection-Members</td>
</tr>
&lt;/tbody&gt;
</table>
</div>
<p><span class="emphasis"><em>Assembly-Parts</em></span> is
equivalent to an encapsulated database record (although databases
don't have to be involved).</p>
<p><span class="emphasis"><em>Collection-members</em></span> is
equivalent to encapsulating an STL style container - there are a
variable amount of members, all of the same type. The <span class=
"emphasis"><em>Collection</em></span> provides an interface through
which all or some of the members. For example, I've written
nhh::Profile which encapulates a year's worth of energy usage
figures - individual members aren't accessed - a Profile is loaded
from the database with <tt class=
"methodname">Profile::LoadFromDatabase()</tt>, manipulated using
mathematical member functions and then saved to the database.</p>
<p><span class="emphasis"><em>Bag-Contents</em></span> is identical
to <span class="emphasis"><em>Collection-members</em></span>, with
one important exception - the type of each <span class=
"emphasis"><em>Member</em></span> can be different. When different
types are in the &quot;Bag&quot;, I prefer to call it a <span class=
"emphasis"><em>Blend-Part</em></span>.</p>
<p>The <span class="emphasis"><em>Whole-Part</em></span> definition
refers to some of the GoF Design Patterns.</p>
<p>The <span class="emphasis"><em>Whole</em></span> can act as a
<span class="emphasis"><em>Mediator</em></span> (273) between
parts, so that different types of <span class=
"emphasis"><em>Part</em></span> can be handled, yielding a more
flexible <span class="emphasis"><em>Whole-Part</em></span>.</p>
<p>The <span class="emphasis"><em>Whole</em></span> can act as a
<span class="emphasis"><em>Fa&ccedil;ade</em></span> (185),
providing a simpler interface to the <span class=
"emphasis"><em>Parts</em></span>. Unlike a normal <span class=
"emphasis"><em>Whole-Part</em></span>, access to each <span class=
"emphasis"><em>Part</em></span> is possible, allowing more
sophisticated users to take advantage of the richer functionality
underneath the surface.</p>
<p><span class="emphasis"><em>Composite</em></span> (163) is an
extremely flexible <span class=
"emphasis"><em>Whole-Part</em></span>. Essentially, there is no
distinction between <span class="emphasis"><em>Whole</em></span>
and <span class="emphasis"><em>Part</em></span> objects. Each
potential <span class="emphasis"><em>Part</em></span> implements
the collection handling interface of <span class=
"emphasis"><em>Whole</em></span> as well as the interface of
<span class="emphasis"><em>Part</em></span>. As a result, each
<span class="emphasis"><em>Part</em></span> can be dynamically made
up of other <span class="emphasis"><em>Parts</em></span>. As is
usual for this kind of thing, the typical example is graphics.
<span class="emphasis"><em>Composite</em></span> can be used so
that routines can handle individual shapes or composite shapes,
with no extra demands made on the code calling the shape's member
functions.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e920" id="d0e920"></a>Meta types -
distant relations.</h3>
</div>
<p>C++ has built-in facilities for meta operations on types
(<tt class="literal">typeid</tt>, <tt class=
"literal">dynamic_cast&lt;&gt;</tt>, derived class pointer
polymorphism). These facilities and the existing class mechanism
can be built on to provide meta facilities more focused on your
problem domain.</p>
<p>Some development environments already provide user defined meta
types as building blocks for frameworks - CObject (MFC), TObject,
TMetaClass (VCL).</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e933" id="d0e933"></a>Design
Patterns.</h3>
</div>
<p>The C++ class keyword is used to implement both User Defined
Types (UDT) and O.O. Design Patterns. How do you tell them apart?
Well, they overlap so much (and patterns are so broad) that any
separation would be a bit of a diversion and a little
artificial&hellip; For more comprehensive details, read &quot;<i class=
"citetitle">Pattern-Oriented Software Architecture</i>&quot; and
supplement it with &quot;<i class="citetitle">Design Patterns</i>&quot;.</p>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e944" id="d0e944"></a>Industrial
revolutions.</h3>
</div>
<p>A programming language provides mechanisms for implementing and
using types. Some <span class="bold"><b>Design Patterns</b></span>
(as in GoF, POSA) are mechanisms that combine the existing
<span class="underline">mechanisms</span> to allow types to be used
more indirectly (i.e. later binding). Prior to the industrial
revolution in Europe, production lay in the hands of guilds and
apprentices. Mass production relied on standard, interchangeable
parts, processed by machines (mechanisms). Design Patterns were a
software revolution that identified the kind of machinery needed.
However, each pattern (machine) had to be hand crafted by experts.
Who will mass-produce the machines (design patterns)?</p>
<p>The next stage of that revolution is taking place. Generic and
Generative programming are a way of mass-producing the machines
(Design Patterns). STL has made GoF's iterators commonplace and
provided a standard interface. More developments are underway
(boost.org is a forum for extending the library and already some
potential contributors are harnessing C++'s powerful constructs to
make other Design Patterns commonplace -e.g. Loki by Andrei
Alexandrescu provides generic <span class=
"underline">implementations</span> of the Visitor and Factory
design patterns [<a href="#DESWC">DESWC</a>].</p>
<p>Mass-production led to widespread standardisation and greater
demand for inter-operability. The existing C++ mechanisms are very
useful but a fair amount of meta-object code has to be implemented
by hand. To tackle this, C++ Builder provides a new keyword,
__closure, which is a form of generalised function pointer which
also has an object pointer associated with it. Loki provides
generalised functors, which provide similar functionality as
__closure without relying on non-standard extensions</p>
<div class="blockquote">
<blockquote class="blockquote">
<p>&quot;at the expense of a slightly less elegant syntax and a small
penalty in efficiency. However, Loki's approach is more general
because it accommodates pointers to functions and functors, in
addition to native pointers to member functions.&quot; - Andrei
Alexandrescu.</p>
</blockquote>
</div>
</div>
<div class="sect2" lang="en">
<div class="titlepage">
<h3><a name="d0e968" id=
"d0e968"></a>Acknowledgements.</h3>
</div>
<p>This is more of a report than an original article - it has
benefited greatly from the ideas &amp; knowledge of Kevlin Henney,
Phil Bass, Mark Radford and Ewan Milne passed on in JaCC lectures,
e-mail conversations and during proof-reading of this article.</p>
<div class="bibliography">
<div class="titlepage">
<h2><a name="d0e973" id="d0e973"></a>Further
Reading</h2>
</div>
<div class="bibliomixed"><a name="SUB" id="SUB"></a>
<p class="bibliomixed">[SUB] Substitutability. Kevlin Henney. JaCC
September 1999, and Overload 39.</p>
</div>
<div class="bibliomixed"><a name="MPD" id="MPD"></a>
<p class="bibliomixed">[MPD] &quot;Multi-Paradigm DESIGN for C++&quot;</p>
</div>
<div class="bibliomixed"><a name="LSP" id="LSP"></a>
<p class="bibliomixed">[LSP] &quot;The Liskov Substitution Principle&quot;
Robert C. Martin, C++ Report March 1996. Available on the back
issues CD or from <span class="bibliomisc"><a href=
"http://www.objectmentor.com/publications/lsp.pdf" target=
"_top">www.objectmentor.com/publications/lsp.pdf</a></span></p>
</div>
<div class="bibliomixed"><a name="DIP" id="DIP"></a>
<p class="bibliomixed">[DIP] &quot;The Dependency Inversion Principle&quot;
Robert C. Martin, C++ Report June 1996. Available on the back
issues CD or can be downloaded from <span class=
"bibliomisc"><a href=
"http://www.objectmentor.com/publications/dip.pdf" target=
"_top">www.objectmentor.com/publications/dip.pdf</a></span></p>
</div>
<div class="bibliomixed"><a name="OCP" id="OCP"></a>
<p class="bibliomixed">[OCP] &quot;Open-Closed Principle&quot; Robert Martin,
C++ Report. <span class="bibliomisc"><a href=
"http://www.objectmentor.com/publications/ocp.pdf" target=
"_top">www.objectmentor.com/publications/ocp.pdf</a></span></p>
</div>
</div>
<div class="bibliography">
<div class="titlepage">
<h2><a name="d0e995" id="d0e995"></a>Further reading
(C++, Design)</h2>
</div>
<div class="bibliomixed"><a name="CPL3" id="CPL3"></a>
<p class="bibliomixed">[CPL3] C++ Programming Language (3e) Bjarne
Stroustrup.</p>
</div>
<div class="bibliomixed"><a name="Design" id="Design"></a>
<p class="bibliomixed">[Design] &quot;Design : Concepts and Practices&quot;
Kevlin Henney JaCC September 1999.</p>
</div>
<div class="bibliomixed"><a name="OOADWA" id="OOADWA"></a>
<p class="bibliomixed">[OOADWA] Object-Oriented Analysis and Design
with Applications (2e) Grady Booch.</p>
</div>
<div class="bibliomixed"><a name="SciEng" id="SciEng"></a>
<p class="bibliomixed">[SciEng] Scientific &amp; Engineering C++
(Barton &amp; Nackman)</p>
</div>
</div>
<div class="bibliography">
<div class="titlepage">
<h2><a name="d0e1006" id="d0e1006"></a>Further
reading (Patterns)</h2>
</div>
<p>Patterns document good practice. Quite a few focus on type
interactions, object interactions and allocation of behaviour.</p>
<div class="bibliomixed"><a name="POSA" id="POSA"></a>
<p class="bibliomixed">[POSA] Pattern-Oriented Software
Architecture: A system of patterns (Buschmann, Meunier, Rohnert,
Sommerlad, Stal).</p>
</div>
<div class="bibliomixed"><a name="GoF" id="GoF"></a>
<p class="bibliomixed">[GoF] Design Patterns (Gamma, Helm, Johnson,
Vlissides).</p>
</div>
<div class="bibliomixed"><a name="PHl" id="PHl"></a>
<p class="bibliomixed">[PHl] Pattern Hatching (Vlissides)</p>
</div>
<div class="bibliomixed"><a name="PLOP" id="PLOP"></a>
<p class="bibliomixed">[PLOP] [PLOP] Pattern Languages of Program
Design (Vol 1-4, Lots O'People).</p>
</div>
<div class="bibliomixed"><a name="ANAPAT" id="ANAPAT"></a>
<p class="bibliomixed">[ANAPAT] Analysis Patterns. A second edition
is being worked on - see <span class="bibliomisc"><a href=
"http://www.MartinFowler.com" target=
"_top">www.MartinFowler.com</a></span>.</p>
</div>
</div>
<div class="bibliography">
<div class="titlepage">
<h2><a name="d0e1025" id="d0e1025"></a>Further
reading (Generic programming)</h2>
</div>
<div class="bibliomixed"><a name="GENPROG" id="GENPROG"></a>
<p class="bibliomixed">[GENPROG] Generative Programming : Methods,
Tools, and Applications (Czarnecki &amp; Eisenecker)</p>
</div>
<div class="bibliomixed"><a name="DESWC" id="DESWC"></a>
<p class="bibliomixed">[DESWC] Design with C++ (Andrei
Alexandrescu, Addison-Wesley 2001). Describes and builds the Loki
library.</p>
</div>
</div>
</div>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
