    <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  :: Modelling and Software Development</title>
        <link>https://members.accu.org/index.php/articles/422</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">Design of applications and programs + Overload Journal #46 - Dec 2001</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/c67/">Design</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/c158/">46</a>
<br />

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

                    -                        <a href="https://members.accu.org/index.php/articles/c67+158/">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;Modelling and Software Development</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 26 December 2001 16:46:08 +00:00 or Wed, 26 December 2001 16:46:08 +00:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e16" id="d0e16"></a></h2>
</div>
<p><span class="emphasis"><em>pattern n. .... 2. a model or design
or instructions according to which something is to be made ...5. a
regular form or order in which a series of actions or qualities
etc. occur....</em></span></p>
<p><span class="emphasis"><em>pattern v. 1. to model according to a
pattern<sup>[<a name="d0e24" href="#ftn.d0e24" id=
"d0e24">1</a>]</sup>.</em></span></p>
<p>Anyone who has studied human geography has probably come across
the work of Walter Christaller. In 1933 he proposed a model to
describe the settlements patterns in southern Germany - see side
bar. While this model shed some light on where settlements had
occurred nobody really expected it to actually give the location of
settlements; it described settlement patterns in an abstracted
way.</p>
<p>Models, by their nature make assumptions to simplify things:
when Airfix produced their model F1-11 - the company attempted to
show you what a particular jet bomber looked like but they never
claimed it would fly (OK, I'm sure I was not the only boy who tried
to fly the odd Airfix model out the bedroom window!)</p>
<p>From a programming perspective we are concerned with information
models: this places us closer to the models of Christaller than
Airfix.</p>
<p>If at this point you wonder what all this has to do with
software let me spell it out: when we create computer systems we
are creating models. Sometimes these are obvious: I once worked in
a department modelling the electricity market, these predictions
where used directly by management to decide which electricity
contracts to sign; sometimes these models are less obvious: a
customer relationship management (CRM) system models the expected
interactions between company and customer, when the model fails we
find post-it notes on people's terminals &quot;If Jack Smith phones
transfers him to Jo.&quot;</p>
<p>Our models have boundaries: within these conditions and
scenarios are dealt with. Some boundaries are explicit, some are
tacit. Economists are familiar with these boundaries: every
economics model comes with the &quot;all other things being equal&quot;
pre-condition. Their models will attempt to describe activity
provided every other boundary condition remains unchanged. In many
cases these models make sweeping generalisations. The monetarist
model (see side bar) attempts to predict inflation in a closed
economy. In itself it is useless because it is so general, but it
does allow economists to reason about an economy. It also forms the
starting point for sophisticated models used by make economic
predictions.</p>
<div class="sidebar">
<p><span class="bold"><b>Central Place Theory</b></span></p>
<p><span class="inlinemediaobject"><img src=
"/var/uploads/journals/resources/modelling_and_software_development_central_place_theory.png"
align="left"></span>Originally devised to explain settlement
patters in southern Germany the theory has been applied to other
settlement patterns and found to fit North American geography well.
After studying southern Germany Christaller devised a model with
assumed a uniform flat plane, with no natural advantages of one
place to another, settlements could occur anywhere. Given this,
where would towns occur? He concluded people cluster in groups
equidistant from one another. Each town would have a hinterland of
equal size. This would result in circular spheres of influence
leaving some areas uncovered so the model uses hexagons instead of
circles, each of which has a town at the centre.</p>
<p>In Cristaller's model natural features like rivers and mountains
where ignored. The model could suggest where settlements would
arise - if there was a river close by the settlement would be a bit
closer to it, natural features could be allowed for when looking at
real settlements. But the model allowed geographers to reason about
settlement patterns, and it provided a common standard to measure
and compare settlement patterns by - it provided a language to
exchange information.</p>
<p>Nobody ever expected to find a perfect example of the model,
that wasn't the point, it was a tool for modelling the real
world.</p>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e51" id="d0e51"></a>What are the
models we build?</h2>
</div>
<p>In software development we build many different kinds of model,
on any project the different models look at the problem domain from
different perspectives.</p>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e56" id="d0e56"></a>Metaphores are
small models</h2>
</div>
<p>Drawing an analogy by metaphor is setting up a small, quick
model: we rely on the fact someone already knows the metaphor, so
when Kevlin compares software development to gardening, he is
relying on the fact that most of use have an idea what gardening
entails.</p>
<p>Metaphores are used in one of two modes:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Educators use a metaphor to describe a new concept to us in
terms of a known one</p>
</li>
<li>
<p>We use it to reason about a system: because X is like Y in one
respect, is it similar in other respects?</p>
</li>
</ul>
</div>
<p>These are the same thing at different points. We tie our subject
(e.g. software engineering) to a target (e.g. gardening) by
pointing out a similarity, then we can follow this up with a less
obvious similarity. In doing this we leverage knowledge in one area
to increase knowledge in another. Think of it as proof by
induction.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e72" id=
"d0e72"></a>Specifications</h2>
</div>
<p>In traditional development a business analyst writes a
specification document that is then implemented. Some organisations
still work this way but many companies make do with a vague
statement of intent: &quot;We intend to build an equities trading
system&quot; - this relies on the developers understanding of what
features an equities trading system should contain, the developers
have their own mental model of what the system needs to do. (This
explains why banks prefer to hire people with experience in the
financial markets and why these people can command premium
wages.)</p>
<div class="sidebar">
<p><span class="bold"><b>Monetrarist theory of money</b></span></p>
<p>One of the simplest economics models it is also one of the most
far reaching, advocated by Milton Friedman and, at least in public,
believed by Margaret Thatcher and Ronald Reagan.</p>
<p><tt class="literal">M x V = P x T</tt></p>
<p>Were, in any given time period:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p><tt class="literal">M</tt> = the quantity of money in
circulation</p>
</li>
<li>
<p><tt class="literal">V</tt> = the velocity of circulation</p>
</li>
<li>
<p><tt class="literal">P</tt> = the price of all goods</p>
</li>
<li>
<p><tt class="literal">T</tt> = number of transactions</p>
</li>
</ul>
</div>
<p>Spending is: money multiplied by the speed at which it changes
hands, this must be equal to all the goods sold in the same time
period at their prevailing price. Obvious really when you think
about it, everything we spend must equal everything we buy.</p>
<p>Hence, if we increase the amount of money in the system,
<span class="emphasis"><em>all other things being equal</em></span>
(velocity and number of transactions remain constant) prices must
raise - inflation, q.e.d.</p>
<p>Again, this is an idealised model and ignores little factors
like savings, investment and what actually constitutes money but
the idea is clear. Some elements of reality can be abstracted away
to show the central concept. More complex models used by banks,
firms and governments peek into the future, each of these makes
assumptions, each has some mathematical model at its heart that,
almost by definition, is inaccurate.</p>
<p>At heart both Christaller's and the Monetarist models are
attempts to reason about information and systems, which is not that
different to what we do when we write a design a system.</p>
</div>
<p>Whether a large document, in developers' heads or on many
individual CRC cards, the specification is a model of the problem.
Yet it is usually incomplete, and frequently inconsistent with
itself.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e122" id="d0e122"></a>Design</h2>
</div>
<p>While I hope all systems have a design, I believe most use the
Topsy Design Pattern: they just grow.</p>
<p>A design is high level representation of the source code and as
such it is indisputably a model. It is a model of the solution, not
the problem.</p>
<p>Like any model, it makes assumptions and abstractions. It is
important that all working on the system understand the model: if I
think we are building an Airfix Lancaster bomber and you think we
building a B17 we may well get something that looks like a four
engined World War II bomber but it will be neither one thing or
another. Auntie Dotty may think it is a good model but her terms of
reference are different to ours.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e131" id="d0e131"></a>Source
code</h2>
</div>
<p>Our ultimate model of the solution: the point where we start to
discover the inconstancies and holes in the specifications.</p>
<p>I once worked on a train timetabling system. The specification
was long and inevitably contained omissions and errors. These where
fixable, even when they occurred late in the development cycle we
could add new rules and change existing ones. The most difficult
problems occurred when rules conflicted each other, usually this
wasn't obvious until the source code was examined and we found that
a fix for requirement A had introduced a bug, requirement A was
quite respectable, but nobody foresaw that when implemented the
result contradicted requirement B. Only when the specification was
codified in the pure logic of code was this clear that neither A
nor B represented the true requirement.</p>
<p>Our voluminous specification model was neither complete nor
self-consistent and much was still locked in people heads.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e140" id="d0e140"></a>Other
models</h2>
</div>
<p>Specification, design and code may be the first models that
spring to mind but there are other models in software
development:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Test suites: test results part way between problem and solution;
they attempt to apply the solution to the problem.</p>
</li>
<li>
<p>Process models: We defined models for how we develop software,
our processes. SSADM, Extreme Programming, waterfall, and such are
models of process. Those who read my article on Extreme Programming
will notice this as one of my criticisms: [3] Beck sets out a model
called <span class="emphasis"><em>Extreme Programming</em></span>
(XP), then, he says: you cannot modify this model, if you do so it
is no longer XP. I can't accept this, XP is a process model, no
team will ever have the exact conditions of the C3 team, it must be
adapted for each case.</p>
</li>
<li>
<p>Delivery schedules: need I say more?</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e158" id="d0e158"></a>What are our
tools?</h2>
</div>
<p>When we use CASE tools like Rational Rose our modelling is
obvious, but even when we write C++, Java and Pascal we are
codifying our logic in a language model. The languages and machines
which run our models are all Turing equivalent so no computer or
language is really more powerful than another, but each brings
different techniques for modelling the problem, for thinking about
the problem, and this is where their power lies.</p>
<p>Object oriented Java is not more powerful than procedural Pascal
because it runs faster; it is more powerful because it allows us to
think, to model, in different concepts.</p>
<p>Beyond language we have notations: when I draw a UML chart you
know that a rectangle means one thing and circle means another.
Actually, I will take exception with my own argument here: I think
many of our notations, especially UML, rely too much on subtleties,
a folded corner on a rectangle means it is different to a regular
rectangle, while a dotted line is different to an solid line. I
think we often try and put too much information into our
notations.</p>
<p>I found the following story in Software Fundamentals:
&quot;<span class="emphasis"><em>if the presenter showed a block
diagram, Dave [Parnas] would ask about the semantics - the meaning
of different block shapes ... the meaning of an arrow; whether an
unfilled arrow meant something different than a solid, filled
arrow... Usually these frills had no meaning. They certainly didn't
aid careful analysis, and they often got in the
way.</em></span>&quot;<sup>[<a name="d0e172" href="#ftn.d0e172" id=
"d0e172">2</a>]</sup></p>
<p>In recent years the patterns community has moved to define more
labels for more models. In the case of the GoF book they defined a
meta-model that could be used to describe all their
models<sup>[<a name="d0e177" href="#ftn.d0e177" id=
"d0e177">3</a>]</sup>. Now when I say Singleton,
Chain-of-responsibility or Mediator you know what I mean - OK, I
deliberately included Mediator because it is not so well known and
this is one of the problems the patterns community faces; it has
been so successful in defining patterns that, outside of a core
half dozen, few are widely known.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e181" id="d0e181"></a>Why are our
models inexact?</h2>
</div>
<p>Like Christaller we can never expect our models to exactly
describe a situation - by their nature they are abstractions. The
simplification we make to create the model and generalise it return
in real life. This brings us to the realm of Chaos Theory, a small
variation can, over time, when repeated, magnify into significant
difference.</p>
<p>We also face the problem of Catastrophe Theory - when multiple
parameters are varied things start to break down. And as if this
weren't bad enough we also have to face the law of diminishing
returns<sup>[<a name="d0e188" href="#ftn.d0e188" id=
"d0e188">4</a>]</sup>.</p>
<p>The key with a model is identifying variability<sup>[<a name=
"d0e194" href="#ftn.d0e194" id="d0e194">5</a>]</sup> however, we
frequently miss points of variability and need to adjust our models
accordingly - but add too many points of variability, too many if's
and but's and instead of a model we have just a list of special
cases.</p>
<p>The more parameters a model has the less useful it is. There is
no model of the game of soccer because there are too many
parameters which can effect the game, we can make generalisations:
Manchester United usually win, Everton usually lose<sup>[<a name=
"d0e200" href="#ftn.d0e200" id="d0e200">6</a>]</sup>.</p>
<p>We should not expect our models to be exact, nor should we
expect to follow them blindly. Sometimes it just doesn't make
sense. Yes, we would like our singletons to be nicely destroyed at
the end of the program, but what does it matter if the OS model
will clean things up? Sometimes the work involved is not justified:
consider the GPS system in a cruise missile, what does a memory
leak matter in the final few milli-seconds before impact?
Attempting to have a GPS-singleton delete itself neatly is more
work for the programmers and adds more variability to a system at
the exact moment when it must be totally predictable.</p>
<p>And not only with code and patterns: the process models of
Yourdon, Jackson and Beck are really just more Christaller models.
Yes, we can learn from them, we can compare ourselves to them, but
to attempt to adopt them as laid out by the authors is about as
sensible as ignoring the a mountain range when building your
village!</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e208" id="d0e208"></a>Summary: Just
what does a model give us?</h2>
</div>
<p>Models provide us with many benefits:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>They give an idea or concept a label</p>
</li>
<li>
<p>A label allows us to communicate more efficiently</p>
</li>
<li>
<p>They allow us to compare different concepts</p>
</li>
<li>
<p>They qualify the main characteristics of an idea</p>
</li>
</ul>
</div>
<p>However, they come with drawbacks:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>No model will ever exactly describe an idea: if it does it is
not a model</p>
</li>
<li>
<p>Because they selectively hide elements that can be manipulated
to the advantage of the modeller</p>
</li>
<li>
<p>Applied incorrectly they can be wasteful on resources: you can't
apply Christaller to mountainous regions; to do so would simply
waste your time.</p>
</li>
</ul>
</div>
<p>The value of a model lies in the abstractions it makes: by
focusing on what the important elements are we are not distracted
by the irrelevant ones. This is a classic definition of software
abstraction but it also brings us back to Christaller: on the
German plains Christaller accurately isolated the abstractions that
describe settlement patterns. But, you would never expect to find
Christaller's settlement patterns exactly because there are things
like rivers, hills, particularly fertile land areas and such.
Equally you should not expect your software model, your pattern, to
describe exactly your software.</p>
<div class="sidebar">
<p><span class="bold"><b>No more green fields</b></span></p>
<p>I carry this model of the perfect job in my mind: at the
interview I'm told: &quot;we have a few people here, we have a problem
and we have no idea of how we are going to solve it&quot;. So, maybe I
never expect to hear this but I settle for: &quot;our current team has
decided to develop a completely new product without using any
existing code&quot;.</p>
<p>What I want is: green field development, a brand new
development, with no old code to maintain, no creaking database
scheme, no legacy source code control system...</p>
<p>In my old age, in my scepticism I don't believe there are any
green field projects left. So much has been done that every area
has been touched by legacy systems. Sometimes this is obvious: we
must keep the current system working; sometimes it is
contradictory: &quot;we are writing a new product but we plan to salvage
as much as we can from the old one&quot;. Even if they were to throw
away all the code they would want to keep the user interface, or
the database format, or the file format.</p>
<p>Yesterday's models form part of today's reality: people's
expectations have changed - 10 years ago a text based calendar
system was magic, today people want an easy to use GUI, voice
control, and, and...</p>
<p>Your perspective is always shaped by what you know and what has
come before; today's problem are shaped by what exists, so, even if
a company doesn't have an application installed they will have
users accustomed to some systems<sup>[<a name="d0e254" href=
"#ftn.d0e254" id="d0e254">7</a>]</sup>.</p>
<p>Some of these advances are good: defining an XML schema is
better than defining a byte-by-byte file format, but such
developments can be limiting: you may need to use XML because it is
a buzz word, forget the fact that you are writing Space Invaders,
you must use XML somewhere! Models can constrain us too.</p>
<p>It is not only technology that limits us. If you think of your
problem domain as a blank canvas, or better, a Christaller like
uniform plain it is still bounded:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Our Easterly edge is compatibility: we must take data from this
system, or produce output for that system, we are asked to reuse as
much of the existing system as we can - even though we are supposed
to replace it!</p>
</li>
<li>
<p>A project deadline and costing forms our Westerly edge: maybe we
have a drop-dead project deadline, or maybe it simply effects our
bottom line! Maybe if we don't deliver in time the company will
cease to be. Even worse can be no deadline, an abyss on the Western
edge into which our team disappears on a blue-sky mission to seek
out and explore strange new technologies.</p>
</li>
<li>
<p>To the North there is the advance of technology: our project
will not be the first, or the last, system already out of date when
delivered; or maybe, you must target 386 Windows 3.1 machines to
save on costly upgrades.</p>
</li>
<li>
<p>And to the South our co-workers: we usually don't get to choose
the people we work with, some are there when we arrive, some are
hired without our involvement; some may be fresh from college and
lacking in real world experience, others may be jaded by too many
failed projects or over exposure to COBAL and Lisp.</p>
</li>
</ul>
</div>
<p>And then when the terrain is not flat and fertile:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Barren patches mean that crops don't take: we may advance
Extreme Programming, templated designs or code reviews but if
people are unenthusiastic, and management won't back you then
nothing will grow.</p>
</li>
<li>
<p>Quagmires: you advance a generic design, but before you can cut
a line of code you are taken at your word and now your design must
work for your department and four others. You are bogged down in
endless meetings, advocacy, design reviews. Sir Humphrey would be
proud!</p>
</li>
<li>
<p>The seasons change: in the autumn the company decides to
standardise on Oracle for all database work, suddenly you must
abandon SQL Server; winter brings a cash flow crisis and nothing
will get signed off; spring brings a thaw but suddenly Java is in
favour, and then summer when everyone is on holiday, nothing is
decided and even less done!</p>
</li>
</ul>
</div>
<p>And through the centre of the plain runs the rift valley of
office politics: will your proposals prove too radical for the
management? Would co-operation with the New York office further
someone's career? Does the office secretary hate contractors and
make their life difficult? Could you use COM in your design? Is the
senior architect convinced he knows all the answers? Is the
director's ear bent by a long standing employee who grew up on
Pascal and frankly, doesn't know the first thing about objects?
Sometimes you have to choose your battles.</p>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e289" id=
"d0e289"></a>Conclusion</h2>
</div>
<p>Models are an essential way of abstracting problems and
patterns. Using models we can codify and communicate ideas - this
in turn allows us to learn and to share ideas. However, as other
disciplines know, models have limits, we should not expect our
idealised models to be used straight out the box. Every model,
whether it is a design pattern, a process or a programming style
must be adapted to our present circumstances.</p>
</div>
<div class="footnotes"><br>
<hr class="c2" width="100">
<div class="footnote">
<p><sup>[<a name="ftn.d0e24" href="#d0e24" id=
"ftn.d0e24">1</a>]</sup> Oxford paperback dictionary, 1983.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e172" href="#d0e172" id=
"ftn.d0e172">2</a>]</sup> Introduction to Abstract Types Defined as
Class Variables, Software Fundamentals: Collected Papers of David
L. Parnas, edited by Hoffman and Weiss, Addison-Wesley 2001.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e177" href="#d0e177" id=
"ftn.d0e177">3</a>]</sup> Design Patterns, Gamma et al,
Addison-Wesley, 1995.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e188" href="#d0e188" id=
"ftn.d0e188">4</a>]</sup> See any good economics text book for a
description of diminishing returns. Nor do I give references for
Chaos theory, Catastrophe theory, Christaller or Monetarism -
likewise these can be found in good mathematics, human-geography
and economics text books. Google searches provide lots of sources
on all.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e194" href="#d0e194" id=
"ftn.d0e194">5</a>]</sup> See Coplien, Multi-Paradigm design in
C++, Addison-Wesley, 1998 for discussions on commonality and
variability analysis.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e200" href="#d0e200" id=
"ftn.d0e200">6</a>]</sup> This will change next season, I'm
sure.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e254" href="#d0e254" id=
"ftn.d0e254">7</a>]</sup> Overload 37, May 2000.</p>
</div>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
