    <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  :: Response To &quot;Patterns - The Abstract Factory&quot; (Francis
Glassborow, Overload 30)</title>
        <link>https://members.accu.org/index.php/journals/560</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>


        <h2>Journal Articles</h2>


<div class="xar-mod-head"><span class="xar-mod-title">Overload Journal #31 - Apr 1999 + Design of applications and programs</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/journals/">All</a>

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

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

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c173/">31</a>
                    (10)
<br />

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

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

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c67/">Design</a>
                    (236)
<br />

                                            <a href="https://members.accu.org/index.php/journals/c173-67/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/journals/c173+67/">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;Response To &quot;Patterns - The Abstract Factory&quot; (Francis
Glassborow, Overload 30)</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 26 April 1999 17:50:52 +01:00 or Mon, 26 April 1999 17:50:52 +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>Dear Editor,</p>
<p>First of all I must say how much I dislike this sort of
cross-over example. It just traps us in the same sort of fruitless
discussion as the square is-a rectangle stuff.</p>
<p>For my money the thing not to lose sight of is the fact that
this is computer programming. That is, we are attempting to
persuade, cajole, and browbeat a box of bits into performing some
sort of work. As we are human beings that task is eased by making a
model which approaches the concrete world. But, and this is a big
but, it must needs be an abstraction and should be focussed on the
behaviour we are aiming for.</p>
<p>How then can I even attempt critical thought about Kitchen
Tools? What is attachment meant to convey? Supply of mechanical
power? What then of modelling supply of electrical power to the
Food Mixer? Is a Food Mixer a Kitchen Tool? Even if it is currently
a supply of mechanical power?</p>
<p>I can't begin to conjecture whether conjuring up duplicates of
kitchen tools using cloning is sane or useful (or ethical) because
we have no frame of reference.</p>
<p>Perhaps we are attempting to build some sort of 'numerical
theorem prover' in an algebra of kitchen appliances? No. What we
are attempting is to show the utility, or otherwise of a pattern in
computer programming, the Abstract Factory. Which is now being
challenged by the Pluggable Factory, in an effort to reduce
coupling if I follow Mr Vlissides correctly.</p>
<p>So what good can come of reading the interfaces with a critical
eye? No requirements spec, no sanity check. Using an apparently
familiar domain is not an adequate substitute for a simple
statement of intent. Still. Here goes.</p>
<p>What gets everybody, at least at first? Still a topic generating
articles in C++ Report too. Lifetimes, Ownership, Pointers and
Leaks. So we look at constructors and clone.</p>
<p>&quot;The concept of a KitchenTool is clearly not something that
should be passed by value.&quot; So we prevent accidental copies and
allow deliberate ones. This is laudable, all guards against our
inevitable errors are to be considered a Good Thing. This is a
difficult enterprise and we all need the help we can get or provide
for ourselves.</p>
<p>But what reference does clone return? How do we guarantee never
to throw from copy construction? Why is clone not const? Why do we
need destroy when the destructor is visible, it allows us to
attempt to call delete on non dynamic instances even more
easily.</p>
<p>Then the factory produces pointers to kitchen tools and the poor
old class user is to manage their lifetimes. They won't. The
kitchen cupboards will be full of gadgets that no one has any
memory of, nor any responsibility for, nor worse yet, any
permission to destroy.</p>
<p>Of course clone also returns a bare, unmanaged, unmanageable
pointer thinly disguised.</p>
<p>We are asked to conjecture about Attachable, and how attachment
should be provided. If the behaviour of the FoodMixer is to
modified I can with a certainty say that it should be told about
attachments applied. If only the question of motive force for the
attachment is considered then only its state, however represented,
is concerned.</p>
<p>Also lurking in here is the problem of access to our factory. If
we want to assure ourselves that only compatible kitchen tools are
available we want one point of access to one type of factory.
Otherwise somewhere in the depths of the program one of our team
without a bean slicer to hand will need one, and will conjure an
arbitrary one, or an arbitrary factory.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e48" id="d0e48"></a>Francis
Glassborow Replies&hellip;</h2>
</div>
<p>Dear Fellow Editor,</p>
<p>I think that Chris Southern's criticism rather misses the point
of my humble attempts to elucidate the 'Abstract Factory Pattern'.
In my more irritable moments I wonder why he was not writing a full
article in response.</p>
<p>The focus of my article was intended to be the Abstract Factory
and not implementing KitchenTools. Yet to my view the burden of his
criticism is on my implementation. I only wish I had the time to do
a fully worked out specification and implementation. I do not, not
even for columns for which I am paid.</p>
<p>I know that there are all kinds of half-baked pieces of code
floating around in my article. I am not sure why I had a <tt class=
"function">destroy()</tt> function, only that it must have seemed a
good idea at something past mid-night when that article was mostly
written.</p>
<p>The concept of clone functions seems entirely reasonable to me,
what seems unreasonable to me is things people call objects that
have public copy semantics. From my viewpoint anything with public
copy semantics is a value. However I certainly may want to
explicitly produce an object as a copy of another one. There is
room for an article on how such a clone function should work and
perhaps one day I will have time to put a few tentative ideas down
for others to critique.</p>
<p>I guess that Abstract Factories should be singletons, but when
we (me and the reader) are trying to understand one idea, it is
probably enough to tackle just one idea. Once we understand an
Abstract Factory it becomes fairly obvious that a program will only
need one.</p>
<p>Perhaps next time Chris has time to do some typing he might
consider a rather more constructive contribution. I am still not
clear whether he fundamentally objects to the concept of an
Abstract Factory, to my choice of idea to get to grips with it or
just to details of my implementation. Perhaps he objects to all
three.</p>
<p>Francis Glassborow</p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
