<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 2.0">
<title>Terminology</title>
</head>

<body bgcolor="#FFFFFF">

<table border="0" width="100%">
    <tr>
        <td><font size="6"><strong>Terminology</strong></font></td>
        <td align="right"><a href="index.html"><img
        src="../image/previous.gif" alt="Previous" border="0"
        width="40" height="40"></a><a href="container.html"><img
        src="../image/next.gif" alt="Next" border="0" width="40"
        height="40"></a></td>
    </tr>
</table>

<hr size="1">

<h2>Class names</h2>

<p>In order to avoid classname clashes between different
libraries, some Eiffel compilers support class renaming in the
Ace file or equivalent. But some don't. Since it is a priority
for the library to be portable across all Eiffel compilers
available on the market today, the name of the classes of the <em>Gobo
Eiffel Structure Library</em> have been systematically prefixed
with the two-letter library-code <font color="#008080"><em><tt>DS</tt></em></font>,
which stands for <font color="#008080"><em><tt>D</tt></em></font>ata
<font color="#008080"><em><tt>S</tt></em></font>tructures. For
example the class name for lists implemented with linkable cells
will be <font color="#008080"><em><tt>DS_LINKED_LIST</tt></em></font>.</p>

<p>Apart from this library-code prefix, class names generally
follow the same convention as those adopted in <a
href="see_also.html#EiffelBase"><em>EiffelBase</em></a>, with
some exceptions mainly for consistency reasons. Names of classes
which describe an abstract property are typically adjectives,
such as <font color="#008080"><em><tt>DS_TRAVERSABLE</tt></em></font>
or <font color="#008080"><em><tt>DS_RESIZABLE</tt></em></font>.
More concrete, but still deferred, classes are <font
color="#008080"><em><tt>DS_LIST</tt></em></font>, <font
color="#008080"><em><tt>DS_STACK</tt></em></font> or <font
color="#008080"><em><tt>DS_TABLE</tt></em></font> for instance.
And finally these data structures are given various
implementations in descendant classes. There are five main kinds
of implementations. Data structures implemented with singly
linkable cells have their names prefixed by <font color="#008080"><em><tt>LINKED</tt></em></font>
such as <font color="#008080"><em><tt>DS_LINKED_LIST</tt></em></font>
or <font color="#008080"><em><tt>DS_LINKED_STACK</tt></em></font>.
Other containers like <font color="#008080"><em><tt>DS_BILINKED_LIST</tt></em></font>
are made up of doubly linkable cells. A third alternative is to
use an array internally, as in <font color="#008080"><em><tt>DS_ARRAYED_LIST</tt></em></font>
or <font color="#008080"><em><tt>DS_ARRAYED_STACK</tt></em></font>.
To avoid too many resizing of these internal arrays, some
containers are implemented with a list of array chunks, such as <font
color="#008080"><em><tt>DS_MULTIARRAYED_STACK</tt></em></font>.
And finally data structures using a hashing mechanism will have
their class names prefixed by <font color="#008080"><em><tt>HASH</tt></em></font>,
<font color="#008080"><em><tt>DS_HASH_TABLE</tt></em></font>
being an example of such class naming.</p>

<h2><a name="feature_names">Feature names</a></h2>

<p>The <em>Gobo Eiffel Structure Library</em> follows the
conventions specified in Dr Meyer's book: <a
href="see_also.html#reusable_software"><em>Reusable Software</em></a><em>,
the base object-oriented component libraries</em>. Apart from the
Eiffel <a href="see_also.html#style_guidelines">style guidelines</a>,
which are enforced in all <em>Gobo Eiffel</em> libraries, this
book also describes the <em><strong>principle of naming
consistency</strong></em> and explains why it is so important
when writing resuable libraries. Since I won't be able to explain
it better than Bertrand Meyer, I'll let you read section 3.8 of
his book, <em>Naming Issues</em>, for a detailed description. If
unfortunately you don't own a copy of this book, you can still
read the article <a
href="http://www.sdmagazine.com/breakrm/features/s995f1.shtml"><em>Rules
of Component Builders</em></a> published in <em>Software
Development</em> online magazine and from which the following
paragraphs are extracted:</p>

<blockquote>
    <p>One lesson my colleagues and I learned early in the
    development of Eiffel libraries is that some issues viewed as
    cosmetic in non-component application development take on a
    critical role in component development. Naming is one of
    them. [...] The consistency principles imply that the names
    must not only be clear but also uniform.</p>
    <p>In the first iteration of <em>EiffelBase</em>, class <font
    color="#008080"><em><tt>STACK</tt></em></font> had operations
    <font color="#008080"><em><tt>push </tt></em><tt>(</tt><em><tt>x</tt></em><tt>)</tt></font>,
    <font color="#008080"><em><tt>pop</tt></em></font>, <font
    color="#008080"><em><tt>top </tt></em></font>for an element <font
    color="#008080"><em><tt>x</tt></em></font>; class <font
    color="#008080"><em><tt>ARRAY</tt></em></font> had <font
    color="#008080"><em><tt>enter </tt></em><tt>(</tt><em><tt>x</tt></em><tt>,</tt><em><tt>
    i</tt></em><tt>)</tt></font> and <font color="#008080"><em><tt>entry
    </tt></em><tt>(</tt><em><tt>i</tt></em><tt>)</tt></font> for
    an integer <font color="#008080"><em><tt>i</tt></em></font>;
    class <font color="#008080"><em><tt>HASH_TABLE</tt></em></font>
    had <font color="#008080"><em><tt>add </tt></em><tt>(</tt><em><tt>x</tt></em><tt>,</tt><em><tt>
    k</tt></em><tt>)</tt></font> and <font color="#008080"><em><tt>value
    </tt></em><tt>(</tt><em><tt>k</tt></em><tt>)</tt></font> for
    a key <font color="#008080"><em><tt>k</tt></em></font>. Using
    such well-accepted names, each well-adapted to each kind of
    structure, emphasized specificity rather than generality.
    This practice is not a problem with a few library classes,
    but with hundreds of components it doesn&#146;t work with the
    &#147;<em><strong>ease of learning</strong></em>&#148;
    requirement: it amounts to requiring the library user to
    learn a specific programming language for every new kind of
    structure. In each case the effort isn&#146;t much, but
    compounded over the practice of large-scale component reuse
    it can defeat the best intentions. As a result of these
    observations, we went to a set of completely systematic
    naming conventions, which I detailed in <a
    href="see_also.html#reusable_software"><em>Reusable Software</em></a>:
    </p>
    <ul>
        <li>The basic replacement or addition operation is always
            called <font color="#008080"><em><tt>put</tt></em></font>
            (replacing <font color="#008080"><em><tt>push</tt></em></font>,
            <font color="#008080"><em><tt>enter</tt></em></font>,
            <font color="#008080"><em><tt>add</tt></em></font>,
            and so on).</li>
        <li>The basic access operation is always called <font
            color="#008080"><em><tt>item</tt></em></font>.</li>
        <li>The basic removal operation is always called <font
            color="#008080"><em><tt>remove</tt></em></font> or <font
            color="#008080"><em><tt>prune</tt></em></font>.</li>
    </ul>
</blockquote>

<p>Of course this may look unusual for programmers used to <font
color="#008080"><em><tt>push</tt></em></font>, <font
color="#008080"><em><tt>pop </tt></em></font>and the like, but
this principle has been well accepted by the Eiffel community.
This is mainly because it is much more important when considering
a class library as a whole to emphasize the commonalities rather
than the differences. The <em>Gobo Eiffel Structure Library</em>
follows the principle of naming consistency and the standardized
feature names used throughout the library classes are described
in the table below:</p>

<blockquote>
    <dl>
        <dt><font color="#008080"><em><tt>after</tt></em></font>,
            <font color="#008080"><em><tt>*_after</tt></em></font></dt>
        <dd>Indicate that all items have been visited when
            traversing a container forward.</dd>
        <dt><font color="#008080"><em><tt>append</tt></em></font>,
            <font color="#008080"><em><tt>append_*</tt></em></font></dt>
        <dd>Add several items to the container. This is the same
            as <font color="#008080"><em><tt>extend</tt></em></font>
            except that the container is automatically resized
            when there is not enough room left.</dd>
        <dt><font color="#008080"><em><tt>back</tt></em></font>, <font
            color="#008080"><em><tt>*_back</tt></em></font></dt>
        <dd>Move the cursor backward.</dd>
        <dt><font color="#008080"><em><tt>before</tt></em></font>,
            <font color="#008080"><em><tt>*_before</tt></em></font></dt>
        <dd>Indicate that all items have been visited when
            traversing a container backward.</dd>
        <dt><font color="#008080"><em><tt>capacity</tt></em></font></dt>
        <dd>Maximum number of items that the container can hold.</dd>
        <dt><font color="#008080"><em><tt>count</tt></em></font></dt>
        <dd>Number of items in the container.</dd>
        <dt><font color="#008080"><em><tt>delete</tt></em></font></dt>
        <dd>Remove all occurrences of an item from the container.</dd>
        <dt><font color="#008080"><em><tt>extend</tt></em></font>,
            <font color="#008080"><em><tt>extend_*</tt></em></font></dt>
        <dd>Add several items to the container. Contrary to <font
            color="#008080"><em><tt>append</tt></em></font>, <font
            color="#008080"><em><tt>extend </tt></em></font>has a
            precondition (<font color="#008080"><em><tt>extendible</tt></em></font>)
            which checks whether there is enough room left in the
            container.</dd>
        <dt><font color="#008080"><em><tt>extendible</tt></em></font></dt>
        <dd>Indicate whether there is enough room left in the
            container to add a given number of items.</dd>
        <dt><font color="#008080"><em><tt>finish</tt></em></font></dt>
        <dd>Move the cursor to the last item in the container.</dd>
        <dt><font color="#008080"><em><tt>first</tt></em></font>,
            <font color="#008080"><em><tt>*_first</tt></em></font></dt>
        <dd>First item in the container, or operations which will
            change this first item.</dd>
        <dt><font color="#008080"><em><tt>force</tt></em></font>,
            <font color="#008080"><em><tt>force_*</tt></em></font></dt>
        <dd>Add an item to the container. This is the same as <font
            color="#008080"><em><tt>put </tt></em></font>except
            that the container is automatically resized when
            there is not enough room left.</dd>
        <dt><font color="#008080"><em><tt>forth</tt></em></font>,
            <font color="#008080"><em><tt>*_forth</tt></em></font></dt>
        <dd>Move the cursor forward.</dd>
        <dt><font color="#008080"><em><tt>has</tt></em></font></dt>
        <dd>Indicate whether an item is included in the
            container.</dd>
        <dt><font color="#008080"><em><tt>is_empty</tt></em></font></dt>
        <dd>Indicate whether the data structure contains at least
            one item.</dd>
        <dt><font color="#008080"><em><tt>is_full</tt></em></font></dt>
        <dd>Indicate whether the maximum number of items limit (<font
            color="#008080"><em><tt>capacity</tt></em></font>)
            has been reached.</dd>
        <dt><font color="#008080"><em><tt>item</tt></em></font>, <font
            color="#008080"><em><tt>item_for_iteration</tt></em></font></dt>
        <dd>Access an item in the container.</dd>
        <dt><font color="#008080"><em><tt>keep</tt></em></font>, <font
            color="#008080"><em><tt>keep_*</tt></em></font></dt>
        <dd>Keep several successive items in the container, and
            remove all the others.</dd>
        <dt><font color="#008080"><em><tt>key</tt></em></font>, <font
            color="#008080"><em><tt>key_for_iteration</tt></em></font></dt>
        <dd>Access a key in the container.</dd>
        <dt><font color="#008080"><em><tt>last</tt></em></font>, <font
            color="#008080"><em><tt>*_last</tt></em></font></dt>
        <dd>Last item in the container, or operations which will
            change this last item.</dd>
        <dt><font color="#008080"><em><tt>*_left</tt></em></font></dt>
        <dd>Operation to be performed to the left of cursor
            position.</dd>
        <dt><font color="#008080"><em><tt>occurrences</tt></em></font></dt>
        <dd>Number of times an item appears in the container.</dd>
        <dt><font color="#008080"><em><tt>prune</tt></em></font>,
            <font color="#008080"><em><tt>prune_*</tt></em></font></dt>
        <dd>Remove several successive items from the container.</dd>
        <dt><font color="#008080"><em><tt>put</tt></em></font>, <font
            color="#008080"><em><tt>put_*</tt></em></font></dt>
        <dd>Add an item to the container, provided that it is not
            full (see <font color="#008080"><em><tt>is_full</tt></em></font>)</dd>
        <dt><font color="#008080"><em><tt>remove</tt></em></font>,
            <font color="#008080"><em><tt>remove_*</tt></em></font></dt>
        <dd>Remove an item from the container.</dd>
        <dt><font color="#008080"><em><tt>replace</tt></em></font></dt>
        <dd>Replace an item by another one in the container. The
            number of items in the container (<font
            color="#008080"><em><tt>count</tt></em></font>) is
            not affected by this operation.</dd>
        <dt><font color="#008080"><em><tt>resize</tt></em></font></dt>
        <dd>Resize the container so that it will have a new <font
            color="#008080"><em><tt>capacity</tt></em></font>. <font
            color="#008080"><em><tt>count</tt></em></font> is not
            affected by this operation.</dd>
        <dt><font color="#008080"><em><tt>*_right</tt></em></font></dt>
        <dd>Operation to be performed to the right of cursor
            position.</dd>
        <dt><font color="#008080"><em><tt>start</tt></em></font></dt>
        <dd>Move the cursor to the first item in the container.</dd>
        <dt><font color="#008080"><em><tt>wipe_out</tt></em></font></dt>
        <dd>Remove all items from the container.</dd>
    </dl>
</blockquote>

<p>Some feature names will be a combination of two of these
standardized names containing an asterisk, such as <font
color="#008080"><em><tt>put_right</tt></em></font> or <font
color="#008080"><em><tt>remove_first</tt></em></font>. Their
meaning should be straightforward: the first routine will add an
item to the right of the cursor position, and the second will
remove the first item of the container.</p>

<h2>Feature categories</h2>

<p>To facilitate class learning, the numerous features of the <em>Gobo
Eiffel Structure Library</em> have been organized into
categories. The Eiffel language is very helpful here with its <em>Feature_clause</em>
construct. Once again consistency is very important. The
standardized feature categories used throughout the library
classes are described in the table below:</p>

<blockquote>
    <dl>
        <dt><font color="#008000"><tt>-- Initialization</tt></font></dt>
        <dd>Creation procedures.</dd>
        <dt><font color="#008000"><tt>-- Access</tt></font></dt>
        <dd>Queries used to get elements or properties about the
            container.</dd>
        <dt><font color="#008000"><tt>-- Measurement</tt></font></dt>
        <dd>Queries concerning the number of elements and size of
            the container.</dd>
        <dt><font color="#008000"><tt>-- Status report</tt></font></dt>
        <dd>Queries used to determine general boolean properties
            of the container.</dd>
        <dt><font color="#008000"><tt>-- Comparison</tt></font></dt>
        <dd>Equality tests between containers.</dd>
        <dt><font color="#008000"><tt>-- Duplication</tt></font></dt>
        <dd>Features which produce copies of the container.</dd>
        <dt><font color="#008000"><tt>-- Setting</tt></font></dt>
        <dd>Procedures which change the general properties of the
            container.</dd>
        <dt><font color="#008000"><tt>-- Cursor movement</tt></font></dt>
        <dd>Procedures that change the cursor position.</dd>
        <dt><font color="#008000"><tt>-- Element change</tt></font></dt>
        <dd>Commands which add or change items in the container.</dd>
        <dt><font color="#008000"><tt>-- Removal</tt></font></dt>
        <dd>Commands which remove items from the container.</dd>
        <dt><font color="#008000"><tt>-- Resizing</tt></font></dt>
        <dd>Commands which change the size of the container.</dd>
        <dt><font color="#008000"><tt>-- Implementation</tt></font></dt>
        <dd>Secret features used for implementation purposes.</dd>
    </dl>
</blockquote>

<p>In order to make the search of features easier throughout the
class text and flat-short forms, the feature categories generally
appear in the same predictable order in the classes.</p>

<hr size="1">

<table border="0" width="100%">
    <tr>
        <td><address>
            <font size="2"><b>Copyright © 1999-2001</b></font><font
            size="1"><b>, </b></font><font size="2"><strong>Eric
            Bezault</strong></font><strong> </strong><font
            size="2"><br>
            <strong>mailto:</strong></font><a
            href="mailto:ericb@gobosoft.com"><font size="2">ericb@gobosoft.com</font></a><font
            size="2"><br>
            <strong>http:</strong></font><a
            href="http://www.gobosoft.com"><font size="2">//www.gobosoft.com</font></a><font
            size="2"><br>
            <strong>Last Updated:</strong> 31 March 2001</font><br>
            <!--webbot bot="PurpleText"
            preview="
$Date$ 
$Revision$"
            --> 
        </address>
        </td>
        <td align="right" valign="top"><a
        href="http://www.gobosoft.com"><img
        src="../image/home.gif" alt="Home" border="0" width="40"
        height="40"></a><a href="index.html"><img
        src="../image/toc.gif" alt="Toc" border="0" width="40"
        height="40"></a><a href="index.html"><img
        src="../image/previous.gif" alt="Previous" border="0"
        width="40" height="40"></a><a href="container.html"><img
        src="../image/next.gif" alt="Next" border="0" width="40"
        height="40"></a></td>
    </tr>
</table>
</body>
</html>
