(Ebook) Object-Oriented Software Development Using Java: Principles, Patterns, and Frameworks / by Xiaoping Jia. ISBN 9780201737332, 0201737337
(Ebook) Object-Oriented Software Development Using Java: Principles, Patterns, and Frameworks / by Xiaoping Jia. ISBN 9780201737332, 0201737337
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374
ebooknice.com
https://ebooknice.com/product/object-oriented-software-engineering-
using-uml-patterns-and-java-7113000
ebooknice.com
https://ebooknice.com/product/object-oriented-software-engineering-
practical-software-development-using-uml-and-java-2450308
ebooknice.com
https://ebooknice.com/product/object-oriented-software-engineering-
using-uml-patterns-and-java-2nd-edition-1407332
ebooknice.com
(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans
Heikne, Sanna Bodemyr ISBN 9789127456600, 9127456609
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
ebooknice.com
https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018
ebooknice.com
(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT
Subject Test: Math Levels 1 & 2) by Arco ISBN 9780768923049,
0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-
arco-master-the-sat-subject-test-math-levels-1-2-2326094
ebooknice.com
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044
ebooknice.com
https://ebooknice.com/product/object-oriented-programming-using-
java-1131714
ebooknice.com
Object oriented software development using Java
principles patterns and frameworks 2nd Edition Xiaoping
Jia. Digital Instant Download
Author(s): Xiaoping Jia.
ISBN(s): 9780201737332, 0201737337
Edition: 2
File Details: PDF, 91.39 MB
Year: 2003
Language: english
Obje_ct-O_rie_11te____ __._eRI_NcLeLEs__ _ _
Xiaoping Jia
DePaul University
~
.
Addison
WPsl<•y
Acces the latest information about Addison-Wesley titles from our World Wide Web site:
www.aw.com/cs
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in this book, and Addison-Wesley
was aware of a trademark claim, the designations have been printed in initial caps or all caps.
Toe programs and applications presented in this book have been included for their instructional
value. They have been tested with care, but are not guaranteed for any particular purpose. The
publisher does not offer any warranties or representations, nor does it accept any liabilities
with respect to the programs or applications.
Credits: Figure 1.2: Kruchten, Rational Unified Process 2nd ed., Fig. 2.2 (p. 23), © 2000
Addi.son Wesley Longman Inc. Reprinted by permission of Pearson Education, Inc. Figure
3.1: Riggs et al, Programming Wireless Devices w/Java 2 Platform, Micro Edition, Fig. 2.1
(p. 8), © 2001 Sun Microsystems Inc. Reprinted by permission of Pearson Education, Inc.
For information on obtaining permission for the use of material from this work, please submit
a wrinen request LO Pearson Education, Inc., Rights and Contracts Department, 75 Arlington
SL, Suite 300, Boston, MA 02116 or fax. your request to 617-848-7047.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system,
or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording,
or otherwise, without the prior written permission of the publisher. Printed in the United States
of America.
2 3 4 5 6 7 8 9 10- HT-05 04 03
To Ai-Ling and Robin
B•,ZiiiiiH
Preface xv
Glossary 653
References 663
Index 667
Object-Oriented Software
Development
CHAPTER OVERVIEW
In this chapter, we provide an overview of object-oriented software development. We
start w ith a general d iscussion of software development processes and the desi@ble
qualities of software products. Next, we discuss what makes software development
difficult and the difference between software engineering and other more established
engineering practices. Then we take a close look at ite@tive software development
processes, including the Rational Unified Process (RUP) and Extreme Programming (XP).
1
2 ■ Object-Oriented Software Development
• On January 15, 1990, the AT&T long-distance telephone network broke down,
interrupting nationwide long-distance telephone services in the United State f or
more than 8 hours. An ill-placed break statement in the switching software,
written in the C language, was to blame for the breakdown.
• On June 4, 1996, the maiden flight of the new and improved Ariane 5 commu
nication satellite launcher developed by the European Space Agency exploded
37 seconds after liftoff. An incorrectly handled software exception resulting from
converting a 64-bit floating point to a 16-bit signed integer caused the disaster.
• On June 8, 200 I, a software problem in the new trading software installed
overnight for the New York Stock Exchange caused failures in trading on half of
the floor of the exchange and forced the NYSE to shut down the entire trading
floor for more than an hour.
Although uch cata trophic failures are rare, minor glitches are common in almost all
oftware. In other words, buggy software is the nom1.
However, the state of oftware development practice i far from the "software
crisis" many have proclaimed in the past. Advances in many aspects of software de
velopment methodologies and software engineering proce ses have made it po ible
I? develop many large-scale software systems that perform as expected most of the
time. We are not capable of delivering nor required to deliver 100% reliable software
The question i , How good i good enough?
1.1 The Challenges of Software Development ■ 3
Complexity The software ystem being developed today are often very large and
complex. Complexity is dictated by the problems the sy tem are intended to solve
and the services they are intended to provide. From the engineering perspective, both
requirements are often beyond the control of software developers. The complexity
involved in a large-scale software system is so great that no individual can comprehend
every detail of the system. To build such a complex sy tem, it mu t be broken down
into manageable parts and requires the cooperative effo11s of a team of developer
rather than the efforts of an individual. Methodologie , techniques, and tool that
work well for small systems developed by individuals usually are not effective for
large systems developed by tean1s.
High User Expectations In the past, whe n computer were mainly u ed in univer-
sitie , research institutions, and large corporation , the majority of software ystem
users were scientists and engineer who had the technical kill 10 handle glitche
they might encounter while using the sy tern . Today, computer are used in home ,
school , and businesses of all size , and are used for plea ure a well a for work.
The majority of today's software u er are nontechnical, ordinary people. Computer
oftware products are con idered more and more like con umer producl and are ex-
pected to perfom1 with the a me depe ndability as hou ehold appliances. Occa ional
glitche that once were con idered acceptable are now intolerable. Software Y tern
are expected to be " bug-free ," but uch perfection i next to impossible.
I>
AN ENGINEERING PERSPECTIVE
..i
The term software engineering was coined al a NATO workshop in 1968. It repre
ented an aspiration to m ch e practice of software development on a solid scientific
foundation and to attain the level of reliability and productivity associated with well
e tabli hed engineering di cipline , uch as civil and mechanical engineering.
Software engineering is �jneering discipline concerned with al�
developing and delivering high-quality and use�i:�ecti-ve-manner.
Software engineering defines the various activities in the software development and
the products, or deliverables, a sociated with these activities. Software engineering
also define the sofnvare development processes, which define the order for carrying
out the development activities and the criteria for the deliverables of the activities.
components, and detail design, which is primarily concerned with the solutions to
each component. Software designs are often documented using various diagrams.
Integration and System Testing The individual components or units are integrated
and tested as a whole to ensure that the entire software system functions properly with
respect to its specification.
The most well-known software development process is the ·<waterfall" model illus-
trated in Figure 1.1, which has been the de facto standard of the software development
process. In the waterfall model, the development activities are carried out in succes-
sive phases linearly: requirements analysis, design, implementation and unit te ting,
integration and system testing, and maintenance. A phase i the pan of time between
two major milestones of the process in which a well-defined et of objective are met,
artifacts are completed, and decisions are made whether to move into the next phase.
In principle, the deliverable of each phase must be approved (" igned off') before the
Figure 1.1
Requirements
l
analysis
The waterfall model
of software devel- +
I
I
opment. '---- - Design
+
,' _____
I
i
Implementation
and unit testing
+
I
I
i
Integration and
·----- system testing
+
I
,_____
I
Maintenance
as
next phase can begin. The rationale is that changes to the requirements specification
cost much less to implement in the requirements analysis than in the later phases. The
later the phase in which a change to the requirements is introduced, the more it costs.
So the goal is to minimize changes after the documents are delivered. This requires
that the tasks of each phase be completed thoroughly, and that the deliverables of each
phase be frozen once they are delivered and approved.
However, the waterfall model is not realistic. It is very common that changes
occur during every phase of the development process. The changes may come from a
number of sources: errors or faults of the specification and design may be discovered
during implementation; assumptions made in design may be proven false during
y tern testing; some features requested by the customers may be proven to be too
low, excessive in resource consumption, or infeasible during system testing; and
user needs and requirements may have changed after the requirements analysis is
completed. Therefore, in practice, it is often necessary to have several iterations of
the phase in the waterfall model. However, one of the major shortcomings of the
waterfall model is that it does not facilitate such iterations.
There are several alternative software development processes that are designed
to carry out the software development activities in an iterative fashion. The itera-
tive software development processes are becoming popular and gaining acceptance
in practice, partly because of the wide acceptance of object-oriented development
methodologies, which are especially suited to iterative development. We will discuss
two of the common iterative development processes in Section 1.4.
N?t all of these desir~ble qualities are attainable at the same time, nor are they of
equal importance. A crucial part of software development is dealing with the trade.-
o~s amo?g these different qualities to achieve a reasonable balance. Obviously, the
obJect-on:nted developm~ t approach cannot directly improve aJI these qualities. It
~cuse~ primarily O!!_improving_the_!!laintainability and reusabj lity of software sys- ,
terns.Maintainability should be the focuo fife development process for three main
reasons. First, for software systems with long lifetimes, maintenance co ts will far ex-
ceed initial development costs. It is imprudent to compromise maintainability because
any savings that may result ini tial ly will undoubtedly be dwarfed by maintenance cost
penalties over the long run. Second, current development technology does not yield
high reliability in the initial release of software sy tern . Reliability i u ually attained
through repeated corrections during the development pha e and throughout the life-
times of software system . Software system reliability can be everely hampered by
poor maintainabi lity. Third, high maintainability require flexibility in the de ign and
implementation of software systems. Such flexibility facilitate the kind of incremen-
tal development that enhances reliability, u efulne s, and u er friendline . a well as
the ability to contain costs.
Several factors contribute to the maintainability of oftware y tern :
These fac tors me the fo us of our discu. sion of methods and techniques in later
chapters.
8 ■ Object-Oriented Software Development
Analysis of Designs
Over the centuries, craftsmanship clearly has proved capable of building magnificent
tructures. such as the Egyptian pyramids, Roman aqueducts, and Notre Dame Cathe-
dral. However, modem engineering offers assurance, predictability, and efficiency
that craftsmanship cannot match. One of the key differences between engineering
and craftsmanship is that the success of engineering projects can be assured before-
hand through scientific analysis of their designs, whereas the success of craftsmanship
projects is attained through trial and error during current and prior construction.
Civil engineers depend on mechanics to help them predict with confidence before
construction begins that a newly designed bridge or building will stand and function
as it is supposed to. Aerospace engineers depend on aerodynamics and simulation to
help them predict with confidence before it is built that a newly designed airplane
will fly.
In contrast, software developers largely depend on testing and debugging (i.e.,
trial and error) to establish confidence in their products. Software development is
like building modern skyscrapers with craftsmanship, with the success of software
development projects rarely assured beforehand.
Nonrecurrence of Failures
Failures, ometimes catastrophic, also occur in well-established engineering fields.
Perhaps one of the most spectacular failures in the history of engineering was the
collapse of the Tacoma Narrows Bridge in 1940. Its design was unconventional and
innovative, and the bridge was dramatic and elegant in appearance. Careful analysis
w~s per~o~ed to en ure that the bridge would behave well under its own weight
with ant1c1pated traffic load and winds as high as 45 miles per hour. However the
~esigner did nor fore~ee that the slender ~ridge deck would act like an airplane ~ing
ma moderate crosswind of less than 40 miles per hour, which twisted the bridge apart.
A oo~ a th~ cause of the collapse _was known, 1~easures were developed to prevent
such failures in the fu1ure. Hence, rn well-established engineering fields, the same
type of failure is rarely repealed.
1.3 Object Orientation ■ 9
In software development, the same types of failures recur all the time. Few
practical measures can be taken to ensure the absence of certain types of faults in
software systems. The sad truth about software development is that no one can ensure
that the type of failure that occurred in Ariane 5 will never occur again.
Codification of Knowledge
The success of well-established engineering fields is due largely to the accumulation
and codification of knowledge and the reuse of prior solutions. Design knowledge
and solutions often are organized and presented in manuals and handbooks to make
common and routine design not only easier and faster, but also more reliable, depend-
able, and manageable. Designers often find solutions inhandbooks and then adapt and
assemble the solutions to their specific design problems. Only rarely are original and
innovative solutions needed. Usually, the codified knowledge includes what to avoid
as well as what to do.
In software development, although a lot of design knowledge and experience has
been accumulated, very little has been systematically codified. Without the benefit of
prior design solutions, each design of a software system i treated as an original.
Therefore, it is no surprise that software design is difficult, time-consuming, and
unreliable.
Thus, software development is quite different from the traditional engineering
disciplines. At best, it is an immature engineering discipline. For software develop-
ment to become a true engineering discipline, software developers must have mech-
anisms to carry out the analysis of designs, ensure nonrecurrence of knm,vn failures,
and codify design knowledge.
The main goal of software development i to build soft\ are y tern that provide
services to people and enhance their abilitie to . olve problem in the real world. A
software system usually con i ts of two e ential component : a model, which is a
representation of a pertinent part of the real world, and an algorithm, which captures
the computation involved in manipulating or proce ing the model.
Software system
Abstraction
Model Algorithm
Interpretation
10 ■ Object-Oriented Software Development
The real world is enonnous and complex. Many of its aspects are fuzzy, unknown,
or intangible. 1n contrast, the programming models used in software systems must be
precise ~d relatively small. A model is necessarily a~ ~bstractio11 of the real world.
It capture only the essential and relevant charactenst1cs of the real wo_rld from a
particular perspective and ignores others. Models are intended to be manipulated or
proce ed. and their behaviors should mimic those of the rea~ worl_d to reflect the
cho en perspectives reasonably accurately. The results of mampulations can be fed
back to the real world through i11terpretatio11 (i.e., the assignment of meanings to the
entitie in the models) and often represent solutions to real-world problems.
Programming languages are the main tools used by software developers to de-
scribe computer models. The evolution of progranuning languages and progranuning
methodologies is driven by the need to build more and more sophisticated and ef-
fective models. That need in turn is driven by the ever-increasing power of modern
computers and the desire to utilize this power.
One of the fundamental problems in software development is, How does someone
model the real world? The answer largely depends on the problems to be solved. One
way to look at the evolution of software development methodologies is through the
changing views of programming models.
In the 1950s and 1960s, the focus of software developers was on the algorithm. As
a result, the main concerns at that time were solving computation problems, designing
efficient algorithms, and controlling the complexity of computation. The models used
were computation-oriented models, and the decomposition of complex systems was
primarily based on control flo w.
In the 1970s and 1980s, different types of models emerged to address the com-
plexity of the data being processed. These systems were centered on data entities
and data fl ows, with computation becoming a secondary concern. The models used
were data-oriented models, and the decomposition of complex systems was primarily
based on data flow.
Object-oriented models represent a balanced view of the data and computation
aspects of software systems. Object-oriented models are composed of objects, which
contain data and the associated computations. The decomposition of complex systems
is based on the structure of objects, classes, and the relationships among them.
The origin of object-oriented software development dates back to the late 1960s. A
computer simulation language called Simula wa,; the first programming language that
included ome important features of object-oriented programming, such as class. The
fir t full -blown and perhaps the best known object-oriented programming language
was Smalltalk, developed by Xerox PARC in the I 970s. Object-oriented technology
grew tremendously during the 1980s, with the emergence of several more sophi _
1.4 Iterative Development Processes ■ 11
■ Each iteration is relatively small and can be completed in a relatively short period
of time.
■ Each iteration results in a release of an executable product or component, which
is a part of the final product.
The final product is developed incrementally from iteration to iteration.
5. Design model: Establishes the vocabulary of the problem and its solution
6. Process model (optional): Establishes the system's concurrency and synchro-
nization mechanisms
7. Deployment model: E tablishes the hardware topology on which the system is
executed
8. Implementation model: Establishes the parts used to assemble and release the
physical sy tem
9. Test model: Establishes the paths by which the system is validated and verified
The RUP i use case driven . Use cases defined for system requirements are the
foundation for all other development activities, including design, implementation,
and te ting. The RUP is architecture centric. The main focus of early iteration of the
development process is to produce and validate an executable architecture prototype,
which gradually evolves to become the final system in later iterations.
The process structure of the RUP can be illustrated in a two-dimensional chart
as hown in Figure 1.2. One dimension represents the time in terms of phases and
itera.tion . The other dimension represents the process work.flows. The chart shows
roughly the amount of time or attention devoted to each process work.flow during
various phases and iterations.
A process workjl.oH consists of a sequence of activities that produce a set of
anifacts, or deliverables, which can be project plans, design models, source code,
tests, and documentations. The RUP defines nine process work.flows:
Environment ~~====::~r;::;::~~==~:,,-::=======-4r========--
lnitlal
~ - - - ~ - ~ ~ #1
I
IElabllElabl 1cons111c onstj[Const j
#2 #N
[l'ra;,1
~ #2
1Tran \
Iterations
1.4 Iterative Development Processes • 15
4. Implementation: Takes into account software development, unit test, and integra-
tion
5. Test: Describes test cases, procedures, and defect-tracking metrics
6. Deployment: Covers the deliverable ystem configuration
7. Con.figuration management: Controls change to and maintains the integrity of a
project's artifacts
8. Project management: Describes various strategies of working with an iterative
process
9. Environment: Covers the necessary infrastructure required to develop a system
Each phase is further broken down into one or more irerations. Each iteration goes
through the various process workflows (de cribed earlier) and i a complete develop-
ment cycle that results in the release of an executable product. The phase serve as the
controlling framework of the iterations. Iteration in different phases have different
emphases on process workflows as illu trated in Figure 1.2. For example, iteration
in the inception phase focus more on business modeling and requirements, while it-
erations in the construction phase focu more on implementation and configuration
management.
refactoring to maintain and improve qualities and to facilitate changes and enhance-
ments.
The core of XP consists of the following key practices:
Planning game: Start with a simple a plan for each iteration, and continually
refine the plan as necessary.
Frequenr and small releases: Make frequent and small releases starting as early
as possible. Each iteration, that is, the duration for producing a release,
bould not be longer than a few weeks.
Metaphor: U e metaphor to start development and communicate with the
customers.
Simple design: Make design as simple as possible. Refactor later if changes are
nece sary.
Test first: Write unit test before writing code.
Refactoring: Refactor to make the system simpler and clearer or to reduce
duplication.
Pair programming: Write all production code in pairs.
Collective ownership: Anyone may change code anywhere in the system to
improve it.
Continuous imegrarion: Integrate as soon as a task is complete.
40-hourweek: Teams are more productive if the members stay fresh and energetic
than if they work overtime.
On-sire customer: Have a customer available on-site and full time.
Coding standards: Adopt common standards and conventions for naming, source
code fonnaning, documentation, and so on.
Undoubtedly, some of the practices are unique to XP, such as pair programming.
Extreme programming and RUP share a lot in common. In some sense, XP can be
viewed as a minimalistic form of the RUP. One of the key differences between the two
is that the RUP emphasizes building object-oriented models using modeling notations
defined in UML, while XP emphasizes producing executable code. However, building
object-oriented model using UML is often done in XP as welJ. Several commonly
used notations of UML will be discussed in Chapter 2. Unit testing and continued
integration will be discus ed in Chapter 6. Refactoring will be one of the main topics
of Chapter 7.
CHAPTER SUMMARY
Brook , F. P. (1987). "No Silver BuUet- E ence and Accident of Software Engi-
neering," IEEE Software 20(4).
Jacob on. I., G. Booch, and J. Rumbaugh ( 1999). The Unified Sofnvare Development
Process. Addi on-Wesle .
Kruchten, P. (2000). The Rational U11ified Proass. A11 Imrodu tio11, 2nd ed. Addison-
We ley.
EXERCISES
1.1 Search the Web or librarie to find out detail of 1.3 Search the Web or libraries to find out whether
some of the catastrophic failure of computer it is permissible to use software engineer as a
systems who e cause ha,·e be-en attributed to professional title without ce1tification in your
software failures. including the one mentioned country or state, and what the rationale is.
in this chapter.
1.2 Search the Web or librarie to find out details
of some failed oftware development projects
and the cause .
Object-Oriented Modeling
Using UML
CHAPTER OVERVIEW
In this chapter, we discuss the basic principles, concepts, and techniques of object-
oriented modeling. We introduce a number of commonly used notations in the Unified
Modeling Language (UML), including class diagrams, object diagrams, sequence dia-
grams, and use case diagrams. We conclude the chapter with a case study of object-
oriented analysis and modeling.
In thi ection, we di u, the ba i con ept and the prin iple , of object-oriented
development. \Ve also introduce some ~ imp le graphi al notations in the Unified
Modeling language (U IL) (Booch et al .. 1999] 1 for des ·ribing obje t-orientcd
models. We u e a sub ·et of U IL notations with minor adJptati ns in synt, x for the
ake of con, isten , ith Ja a.
l. Ul\ IL is a stand:.ml for objc~t-orienteJ moJ ling no1~11i 1ns cnJol'\ed by the Object I\ 1:magcmcnt Group
(0 •IG), nn indu ·trial ron ·t,rtium on obj~ct tc~hnologics.
19
-
20 ■ Object-Oriented Modeling Using UML
Each object has a unique identity. The identity of an object distinguishes the
object from all other objects. The state of an object is composed of a set of fields, or
arrribules. Each field bas a name, a type, and a value. The behavior of an object
is defined by a set of methods that may operate on the object. In other words, a
method may access or manipulate the state of the object. Methods are sometimes
called operations, and we consider these two tenns to be synonymous. Each method
al.so bas a name, a type, and a value. The type of a method consists of the return type
and the list of parameter types of the method. The return type can be void if the
method does not return a value. The value of a method is the implementation of the
method often expressed as a sequence of statements, in languages like Java or C++.
The features of an object refer to the combination of the state and the behavior of the
objecL
Two objects are equal if their states are equal, that is, if the values of the
corre ponding fields of the two objects are equal. Two objects are identical if they are
the ame object, that is, if they have the same identity.
The value of the field of an object are mutable. Those methods of an object
chat do not modify the slate of the object are called accessors, and those methods
of an object char could modify the state of the object are called mutators. A mutable
object is an object whose state may be modified by some of its methods. A mutable
object may have different states at different times. An immutable object is an object
2.1 Principles and Concepts • 21
whose state may never be modified by any of its methods, that is, an object that has
no mutators. The tate of an immutable object remains constant. Objects are usually
mutable. However, immutable objects are quite useful too.
A class defines a template for creating or instantiating its instances, that is,
objects. The terms object and instance are often interchangeable. The class from
which an object is created is referred to a the class of the object, and the object
is referred to as an instance of the clas . In mo t object-oriented languages, including
Java and C++, in tead of defining the feature of individual objects, the features of
objects are defined in the class that instantiate the object . Specifically, a class defines
(1 ) the names and types of all fi eld and (2) the name . type , and implementations of
all methods. The values of the fields are not defined or fixed in the class definition. The
values of the fields are mutable. Each instance of the clas · ha its own state. Different
instances of the class may have different state . The implementation of methods are
defined in the class definition and are therefore fixed for a given object. In other word ,
the values of method of an object are immutable.
Let's look at a simple cla Point that repre ent points in a two-dimensional
space. The Java code defining the class is shown on the right-hand ide.
The Point class defines two field : x and y, and one method: move O. The type
of both fields is i nt . The return type of move () i void and the Ii t of the p:irarneter
types of move() i (int, i nt ), since it take two parameter both of type int.
method,
The bon m comparunent contains the declaration. of the methods
... of the cla :
methodm
If, in ome context, the detail of the field - and method of the la s i. not important,
one may omit both the middle and the b tt m l'0mpa.rtments.
22 • Object-Oriented Modeling Using UML
The visibility, or accessibility, of fields and methods defines the scope in which
features of classe are accessible. Visibility can be one of the following:
The acces ibility of features will be discussed in more detail in Section 4.4.1. T he
Java and UML syntaxes for visibility are as follows:
public public +
protected protected #
package
private private
2. In 1his book. we use the following convention to defi ne syntax: the notation Foo (e g •n , 1 ) d t
. I bI . I bol h . f .., •1/ e eno es a
nonlcnmna ~ym o ; 1em11na sym s ~re~ own 111 bold ace Courier font (e.g., •). The entities between
square brackets ! J (e.g., (T)peJ) arc opllonal.
J. Packages arc discussed laler in this section fp. 25] and in Section 4.5 Ip. 134].
• I•
2.1 Principles and Concepts • 23
The multiplicity specification of a field specifies whether an object may have mul-
tiple occurrences of the field. The multiplicity specification is defined in Section 2.2.2
[p. 33].
Each parameter of a method can be specified using the Java syntax as follows:
Type Name
Name: Type
Field declarations
Date birthday (Java syntax)
birthday : Date (UML syntax)
Method declarations
void move ( int dx, i nt dy) (Java yntax)
-move (dx: i nt, dy : int) (UML ynta"<.)
The Point cla s shown earlier can be repre ented in UML as follm • at different
levels of detail.
Point
private int x
private int y
public void move(int dx, int dy)
-
24 ■ Object-Oriented Modeling Using UML
Point
-x:int
-y:int
+move(dx:int, dy:int)
Abbreviated fonns:
Point
X
y
move()
There are a number of variations for the contents of the top compartment:
• objectName
Omission of the colon and the class name denotes an object named obj e ctN ame
whose class is of no interest.
• : ClassName
Omission of the object name denotes an anonymous object of class ClassName,
which can be identified only through its relationship with other objects.
The fields and their values in the bottom compartment are described with the
foUowing syntax:
Field• Value
The bottom compartment may be omitted altogether if the attributes and values of an
object are of no interest
2.1 Principles and Concepts • 25
For example, instances of the Point class, with the states (0, 0) and (24, 40),
can be represented graphically as follows:
The Java code segment, on the right, shows the creation of the instances and the
assignment of the states.
Recipient pl
p1.move(10, 20) Method move()
Arguments (10, 20)
Packages
Classes are often grouped into a package. Package. an be organized into a hierarchy.
In other words, a package may contain cla e and -ubpackage . It i important
to point out that all clas e in the ame package mu t be clo ely related, since all
feature of a cla , except tho e that are private. are ac e ible to all cla e in the
ame pa kage. Detail. for u ing pa .kag ' in Java, ill be di cus ed in Section 4.5. l .
-
26 ■ Object-Oriented Modeling Using UML
(a)
2.1.2 Principles
Modularity
One of the fundamental principles of the object-oriented approach is the principle of
modularity. It is intended to control the complexity of large-scale systems through the
use of the divide-and-conquer technique.
Pri~ Modularity
A complex software system should be decomposed into a set of highly cohesive but
loo ely coupled modules.
■ each module is relatively small and simple (that is, hjghly cohesive); and
■ the interactions among modules are relatively simple (that is, loosely coupled),
ensuring that- by examining the module within, not without-each module will
be well-behaved and that, if all the modules are well-behaved, the entire system
also wiU be well-behaved.
Abstraction
In its purest sense, abstraction means separating the e ential from the none ential
characteristics of an entity. The result is a simpler but sufficiently accurate approx-
imation of the original entity, obtained by removing or ignoring the none enrial
characteristics. The abstraction principle in software development can be described
as follows:
Principle Abstraction
The behaviors, or functionalities, of a module bouJd be cbara terized in a uccinct
and precise description known as the co11tractual interface of the module. In other
words, the contractual interface capture the e en e of the behavior of the module.
The contractual interface is an ab traction of the module.
We can view a module a a senice provider and other module that u e the
services provided by the module as cliems of the module. \: e an view the contractual
interface as the service contract bet\ een the ervice pro idcr and it. clients.
service contract need only de cribe what e.rvi es ·ru1 be pro ided, not how the
service are to be provided. Therefore, de pite the fact that the rvice to be pro ided
are very complex, the , ervice ontract may be very imp le. ith a imple ervice
contract and an as uran .e by the . ervice provider of h noring the ontracl. the client
need only undectand the · imple contra t in order to u ·e the comp le , service .. The
contractual interfa e alto, s the client to u, e the . ervice , and not be oncemed with
the complexity of the er ice ·. In other , ord~. the comple. it of the module i hidden
within it.
Let us onsider the exrunpk of th telephone . The mechani m for providing
telephone . er ice i , a rather comp le. one. lt in olws routing and connecting calls,
28 • Object-Oriented Modeling Using UML
convening voice to electronic signals and back to voice, transmitting the signals. in
analog or digital mode, and possibly encrypting and decrypting the signals f~r secunt;
reason . However, telephone users (that is, the clients of a telephone service) don t
need to understand the mechanics of a phone system. All the users need to understand
i the manual that comes with the telephone set, which includes instructions on dialing,
speaking. and hanging up. The user's manual in this case is the contractual interface
of the telephone service, and it serves as an abstraction of the telephone service from
the user's perspective.
Encapsulation
A closely related and complementary principle is encapsulation, which stipulates that
the clients need know nothing more than the service contract while using the service.
Principle Encapsulation
The implementation of a module should be separated from its contractual interface
and hidden from the clients of the module.
Polymorphism
Several different service providers can honor the same contractual interface. More-
over, these service providers can be interchanged without affecting the clients. The
2.2 Modeling Relationships and Structures • 29
In this section, we introduce the UML class diagram for modeling the tatic tructures
of object-oriented software systems and various types of relation among the cJas es.
Class diagrams are the most common diagrams used in object-oriented modeling. A
class diagram consists of
■ a set of nodes that represent classes and interface ; and
■ a set of links that represent relationship among clas es.
2.2.1 Inheritance
4. The word poly111orphis111 ml!un · an i:nLity , ilh multiple~ m1 ·. In lhis particular context, it refer to a
conlructual inlcrfm:i: , ilh multiple interchangeable impkmcntntions.
--
■ The txtension relation between two interfaces. When interface 12 extends inter-
face l 1, interface 12 is known as a subinterface of interface l 1, and interface l 1
is known as a superinterface of interface 12.
■ The implementation relation between a class and an interfacq. When class C2
implements interface 11, class C2 is known as an implementation of interface
11, and interface 11 is known as an inte1face of class C2.
UML uses a different terminology for inheritance relationships. The extension relation
is also known as specialization, and the inverse relation is known as generalization
in UML. The implementation relation is also know as realization in UML.
Graphically, the inheritance relation is represented by a link from the subclass/
subinterface to the superclass/superinterface with a hollow triangle pointing toward
the superclass. The extension relation is represented by a solid link, and the imple-
mentation relation is represented by a dashed link, as shown in Figure 2.2. In class
diagrams, the regular class, field, and method names are shown in upright roman fonts,
as in MyClass. The names of interfaces and its methods are shown in italic fonts, as
in Mylnterface.
Conceptually, inheritance models the is-a(n) relationship in the real world; that is,
if C2 is a subclass/subinterface/implementation of Cl, then every instance of C2 is an
instance of Cl, and everything that applies to instances of Cl also applies to instances
of C2. The ex.tension relation between two classes is commonly associated with the
notion of reusing or sharing the implementation (that is, the fields and methods) of a
superclass by its subclasses. The extension relation between two interfaces represents
the expansion of the service contract. The implementation relation does not connote
reuse of implementations, but rather the implementation of a contractual interface by
a class.
As an example, let us consider the following set of classes that represent different
groups of srudents in a university. The class diagram is shown in Figure 2.3.
F"tgure 2.2
Superclass Superinterface Interface
6.
UML notation fOf'
lnhattana r~la-
tionships.
Subclass Subinterface Implementation
Figure 2.3
Student
Class diagram: in-
heritance relation
among classes rep- Nondegree Undergraduate Graduate
resenting student
groups.
Master PhD
Class Description
Levels of Abstraction
Cla. se and interface repre ent ab traction , and the inheritance relation hip orga-
nizes the cla ses and interfa e into different level of ab traction.
32 ■ Object-Oriented Modeling Using UML
1n other words, the superclasses represent more general abstractions and the
subclasses repre ent more specialized abstractions. Consider again the example of
tudents hown in Figure 2.3. The inheritance hierarchy shows different levels of ab-
straction of students in a university. The Student class represents the most general
ab traction of tudents, whereas its subclasses represent various specialized abstrac-
tions of tudents. The leaf classes (that is, classes with no subclasses) represent the
most pecialized ab tractions of students.
2. 2-2 Association
Figure 2.4
Class1I
- - - - ~ role
name
I Class2
role ~-----'
UML notation for
association rda-
tionship.
2.2 Mod~ing Relationships and Structures • 33
Figure 2.5
Student 1-•-_ _e_n_ro __
_ll_► -1
Course
Class diagram: as- advisee •
sociation relation-
ships.
• teach
1
1
Faculty
adviser
with Facult y and Student, respectively, in the association between Faculty and
Student . The role name may also have an optional vi ibility designator, that is +,
#, - ,or-.
The multiplicity specification is a comma-separated sequence of integer intervals.
An integer interval can be one of the following:
l . .u specifies a closed, that is, inclusive, range of integers from the lower bound
I to the upper bound u. Both the lower and upper bound are integer literals.
The upper bound may also be the asterisk character ( ), which indicates an
unlimited upper bound.
i specifies a singleton range that contains integer i, which is an integer literal.
* specifies the entire nonnegative integer range: 0. 1. 2. 3.. ..
0 . ·* 0 or more
1. · * 1 or more
2 .. 5 2 to 5
2, 5, 7 2, 5, and 7
1, 3, 5. ·* I, 3, and 5 or more
In Figure 2.5, the enroll a ociation i man -to-man ; that i a tudent may enroll
in any number of course . and a ourse ma have any number of tudent · enrolled
in it. The reach association i one-to-man ; that i ·. ea h ourse has onl one faculty
member to teach it, but a fa ult member ma tench an number of course . The
adviser-advisee a ·ociation L al o one--to-man ; that i , ea b . tudenl ha. one advi er,
but an advi er may ha e any number of ad i ee ·.
The graphical notation of an a iation ma al o indi ate the navigation of
the a o iation. If there i, a dire t or indirect refere nee from cl Cl to clas C2,
then it is navigabl from Cl to C2. n as , iation ma b nn igable in one or both
dire tions. By default, an a. s iation is a · ·urned to be navigable in both direction .
If nn a o iation is only navigable in one dire tion, it mu t be explicitly hown with
Discovering Diverse Content Through
Random Scribd Documents
smile, made as if to rise, leaning forward with quick attention. Then
my father shook Jason till he reeled and clutched at him.
“Have a mind what you say, you mad cur!” he cried in a terrible
voice.
“It’s true! Let me go! He confessed it all to me—to me, I say!”
I stood up among them alone, stricken, and I was not afraid. I was
a better man than my accuser; a better brother, despite my sin. And
his dagger, plunged in to destroy, had only released the long-
accumulating agony of my poor inflamed and swollen heart.
“Father,” I said, “let him alone. It is true, what he says.”
He flung Jason from him with violence.
“Move a step,” he thundered, daring him, “and I’ll send you after
Modred!”
He came to me and took me gently by the shoulder.
“Renalt, my lad,” he said, “I am waiting to hear.”
I did not falter, or condone my offense, or make any appeal to
them whatsoever. The kind touch on my arm moved me so that I
could have broken into tears. But my task was before me and I could
afford no atom of self-indulgence, did I wish to get through it bravely.
As I had told my story to Jason, I told it now; and when I had
finished I waited, in a dead silence, the verdict. I could hear my
brother breathing thickly—expectantly. His fury had passed in the
triumph of his own abasement.
Suddenly my father put the hand he had held on my shoulder
before his face and a great sob coming from him broke down the
stone walls of my pride.
“Dad—dad!” I cried in agony.
He recovered himself in a moment and moved away; then faced
round and addressed me, but his eyes looked down and would not
meet mine.
“Before God,” he said, “I think you are forgiven for a single impulse
we all might suffer and not all of us recoil from the instant after, but I
think that this can be no place for you any longer.”
Then he turned upon Dr. Crackenthorpe.
“You!” he cried; “you, man, who have heard it all, thanks to that
dirty reptile yonder! Do you intend to peach?”
The doctor pinched his wiry chin between finger and thumb, with
his cheeks lifted in a contemplative fashion.
“The boy,” he said, “is safe from any one’s malice. No jury would
convict on such evidence. Still, I agree with you, it’s best for him to
go.”
“You hear, Renalt?” said my father. “I’ll not drive you in any way, or
deny you harbor here if you think you can face it out. You shall judge
for yourself.”
“I have judged,” I answered; “I will go.”
I walked past them all, with head erect, and up to my room, where
I sat down for a brief space to collect my thoughts and face the
future. Hardly had I got hold of the first end of the tangle when there
came a knock at the door. I opened it and Zyp was outside.
“You fool!” she whispered; “you should have done as I told you. It’s
too late now. Here, take this. Dad told me to give it you”—and she
thrust a canvas bag of money into my hand, looking up at me with
her unfathomable eyes.
As I took it, suddenly she flung her arms about my neck and
kissed me passionately, once, twice, thrice, on the lips, and so
pushed me from her and was gone. And as I stood there came to my
ears a faint wail from above, and I said to myself doggedly: “It is a
gull flying over the house.”
Taking nothing with me but cap, stick and the simple suit of clothes
I had on, I descended the stairs with a firm tread and passed the
open door of the sitting-room. There was silence there, and in
silence I walked by it without a glance in its direction. It held but bitter
memories for me now and was scarce less haunted in its way than
the other. And so to me would it always be—haunted by the beautiful
wild memory of a changeling, whose coming had wrought the great
evil of my life, to whom I, going, attributed no blame, but loved her
then as I had loved her from the first.
The booming of the wheel shook, like a voice of mockery, at me as
I passed the room of silence. Its paddles, I thought, seemed reeling
with wicked merriment, and its creaking thunder to spin
monotonously the burden of one chant.
“I let you go, but not to escape—I let you go, but not to escape.”
The fancy haunted my mind for weeks to come.
In the darkness of the passage a hand seized mine and wrung it
fiercely.
“You don’t mean to let the grass grow on your resolve, then,
Renalt?” said my father’s voice, rough and subdued.
“No, dad; I can do no good by delaying.”
“I’m sore to let you go, my boy. But it’s for the best—it’s for the
best. Don’t think hardly of me; and be a fine lad and strike out a path
for yourself.”
“God bless you, dad,” I said, and so left him.
As I stepped into the frosty air the cathedral bells rung out like iron
on an anvil. The city roofs and towers sparkled with white; the sun
looked through a shining mist, giving earnest of gracious hours to
come.
It was a happy omen.
I turned my back on the old decaying past and set my face toward
London.
CHAPTER XIII.
MY FRIEND THE CRIPPLE.
It was broad day when we emerged from the inclosure, and sound
was awakening along the wintry streets. London stood before me
rosy and refreshed, so that she looked no longer formidably
unapproachable as she had in her garb of black and many jewels. I
might have entered her yesterday with the proverbial half-crown, so
easily was my lot to fall in accommodating places.
Duke Straw, whom I was henceforth to call my friend, conducted
me by a township of intricate streets to the shop of a law stationer, in
a petty way of business, which stood close by Clare market and
abutted on Lincoln’s Inn Fields. Here he had a little bedroom,
furnished with a cheap, oil-cooking stove, whereon he heated his
coffee and grilled his bacon.
Simon Cringle, the proprietor of the shop, was taking his shutters
down as we walked up. He was a little, spare man, with a vanity of
insignificance. His iron-gray hair fell in short, well-greased ringlets
and his thin beard in a couple more, that hung loose like dangled
wood shavings; his coiled mustaches reminded one of watch
springs; his very eyebrows, like bees’ legs, were humped in the
middle and twisted up into fine claws at the tips. Duke, in his search
for lodging and experience, had no sooner seen this curiosity than
he closed with him.
He gave my companion a grandiloquent “Good-morning.”
“Up with the lark, Mr. Straw,” said he, “and I hope, sir, with success
in the matter of getting the first worm?” Here he looked hard at me.
“He found me too much of a mouthful,” said I; “so he brought me
home for breakfast.”
Duke laughed.
“Come and be grilled,” said he. “Anyhow they roast malt-worms in
a place spoken of by Falstaff.”
We had a good, merry meal. I should not have thought it possible
my heart could have lightened so. But there was a fascinating
individuality about my companion that, I am afraid, I have but poorly
suggested. He gave me glimmerings of life in a higher plane than
that which had been habitual to me. No doubt his code of morals
was eccentric and here and there faulty. His manner of looking at
things was, however, so healthy, his breezy philosophy so infectious,
that I could not help but catch some of his complaint—which was,
like that of the nightingale, musical.
Perhaps, had I met him by chance six months ago, my
undeveloped soul would have resented his easy familiarity with a
cubbish snarl or two. Now my receptives were awakened; my armor
of self-sufficiency eaten to rags with rust; my heart plaintive for
communion with some larger influence that would recognize and not
abhor.
At 8:45 he haled me off to the office, which stood a brief distance
away, in a thoroughfare called Great Queen street. Here he left me
awhile, bidding me walk up and down and observe life until his chief
should arrive, which he was due to do at the half-hour.
I thought it a dull street after some I had seen, but there were
many old book and curiosity shops in it that aroused my interest.
While I was looking into one of them I heard Duke call.
“Here,” he said, when I reached him; “answer out and I think
Ripley will give you work. I’m rather a favorite with him—that’s the
truth.”
He led me into a low-browed room, with a counter. Great bales of
print and paper went up to the ceiling at the back, and the floor
rumbled with the clank of subterranean machinery. One or two clerks
were about and wedged into a corner of the room was a sort of
glazed and wooden crate of comfortable proportions, which was, in
fact, the chapel of ease of the minister of the place.
Into this den Duke conducted me with ceremony, and, retreating
himself, left me almost tumbling over a bald-headed man, with a
matted black beard, on which a protruding red upper lip lay like a
splash of blood, who sat at a desk writing.
“Shut the door,” he said, without looking up.
“It is shut, sir.”
He trailed a glance at me, as if in scrutiny, but I soon saw he could
only have been balancing some phrase, for he dived again and went
on writing.
Presently he said, very politely, indeed, and still intent on his
paper: “Are you a cadet of the noble family of Kinsale, sir?”
“No, sir,” I answered, in surprise.
“You haven’t the right to remain covered in the presence of the
king?”
“No, sir.”
“Well, I’m king here. What the blazes do you mean by standing in
a private room with your hat on?”
I plucked it off, tingling.
“I’m sorry,” I said. “Mr. Straw brought me in so suddenly, I lost my
head and my cap went with it, I suppose. But I see it’s not the only
thing one may lose here, including tempers!” And with that I turned
on my heel and was about to beat a retreat, fuming.
“Come back!” shouted Mr. Ripley. “If you go now, you go for good!”
I hesitated; the memory of my late comrade restored my
equilibrium.
“I didn’t mean to be rude, sir,” I said. “I shall be grateful to you if
you will give me work.”
He had condescended to turn now, and was looking full at me with
frowning eyes, but with no sign of anger on his face.
“Well, you can speak out,” he said. “How do you come to know
Straw?”
“I met him by chance and we got talking together.”
“How long have you been in London?”
“Since yesterday evening.”
“Why did you leave Winton?”
“To get work.”
“Have you brought a character with you?”
Here was a question to ask a Trender! But I answered, “No, I
never thought of it,” with perfect truth.
“What can you do?”
“Anything I’m told, sir.”
“That’s a compromising statement, my friend. Can you read and
write?”
“Yes, of course.”
“Anything else?”
“Nothing.”
“Nothing? Don’t you know anything now about the habits of birds
and beasts and fishes?”
“Oh, yes! I could tell you a heap about that.”
“Could you? Very well; I’ll give you a trial. I take you on Straw’s
recommendation. His opinion, I tell you, I value more than a score of
written characters in a case like this. You’ve to make yourself useful
in fifty different ways.”
I assented, with a light heart, and he took me at my word and the
further bargain was completed. My wages were small at first, of
course; but, with what I had in hand, they would keep me going no
doubt till I could prove myself worth more to my employer.
In this manner I became one of Ripley’s hands and later on myself
a pamphleteer in a small way. I wrote to my father that evening and
briefly acquainted him of my good fortune.
For some months my work was of a heterogeneous description.
Ripley was legitimately a job printer, on rather a large scale, and a
bookbinder. To these, however, he added a little venturesomeness in
publishing on his own account, as also a considerable itch for
scribbling. Becoming at a hint a virulent partisan in any extremist
cause whatsoever, it will be no matter for wonder that his private
room was much the resort of levelers, progressives and abolitionists
of every creed and complexion. There furious malcontents against
systems they were the first to profit by met to talk and never to listen.
There fanatical propagandists, eager to fly on the rudimentary wing
stumps of first principles, fluttered into print and came flapping to the
ground at the third line. There, I verily believe, plots were laid that
would presently have leveled powers and potentates to the ground at
a nod, had any of the conspirators ever possessed the patience to sit
on them till hatched. This, however, they never did. All their fiery
periphrastics smoked off into the soot of print and in due course
lumbered the office with piles of unmarketable drivel.
Mr. Ripley had, however, other strings to his bow, or he would not
have prospered. He did a good business in bookselling and was
even now and again successful in the more conventional publishing
line. In this connection I chanced to be of some service to him, to
which circumstance I owed a considerable improvement in my
position after I had been with him getting on a year. He had long
contemplated, and at length begun to work upon, a series of
handbooks on British birds and insects, dealt with county by county.
In the compilation of these much research was necessary, wherein I
proved myself a useful and painstaking coadjutor. In addition,
however, my own knowledge of the subject was fairly extensive as
regarded Hampshire, which county, and especially that part of it
about Winton, is rich in lepidoptera of a rare order. I may say I fairly
earned the praise he bestowed upon me, which was tinged, perhaps,
with a trifle of jealousy on his part, due to the fact that the section I
touched proved to be undoubtedly the most popular of the series, as
judged subsequently by returns.
Not to push on too fast, however, I must hark back to the day of
my engagement, which was marked by my introduction to one who
eventually exercised a considerable influence over my destinies.
During the course of that first morning Mr. Ripley sent me for some
copies of a pamphlet that were in order of sewing down below. By
his direction I descended a spiral staircase of iron and found myself
in the composing-room. At a heavy iron-sheeted table stood my new-
found friend, who was, despite his youth, the valued foreman of this
department. He hailed me with glee and asked: “What success?”
“All right, thanks to you,” I said; “and where may the bookbinding
place be and Dolly Mellison?”
“Oh, you’re for there, are you?” he said, with I thought a rather
curious look at me, and he pointed to a side door.
Passing through this I found myself in a long room, flanked to the
left with many machines and to the right with a row of girls who were
classifying, folding or sewing the sheets of print recent from the
press.
“I’m to ask for Dolly Mellison,” I said, addressing the girl at my end
of the row.
“Well, you won’t have far to go,” she said. “I’m her.”
She was a pretty, slim lily of a thing, lithe and pale, with large gray
eyes and coiled hair like a rope of sun-burned barleystraw, and her
fingers petted her task as if that were so much hat-trimming.
“I’m sent by Mr. Ripley for copies of a pamphlet on ‘The
Supineness of Theologicians,’” I said.
“I’m at work on it,” she answered. “Wait a bit till I’ve finished the
dozen.”
She glanced at me now and again without pausing in her work.
“You’re from the country, aren’t you?”
“Yes. How do you know?”
“A little bird told me. What gave you those red cheeks?”
“The sight of you,” I said. I was growing up.
“I’m nothing to be ashamed of, am I?” she asked, with a pert
laugh.
“You ought to be of yourself,” I said, “for taking my heart by storm
in that fashion.”
“Go along!” she cried, with a jerk of her elbow. “None of your
gammon! I’m not to be caught by chaff.”
“It wasn’t chaff, Dolly, though I may be a man of straw. Is that what
you meant?”
“You’re pretty free, upon my word. Who told you you might call me
by my name?”
“Why, you wouldn’t have me call you by any one else’s? It’s pretty
enough, even for you.”
“Oh, go away with you!” she cried. “I won’t listen.”
At that moment Duke put his head in at the door.
“The governor’s calling for you,” he said. “Hurry up.”
“Well, they’re ready,” said the girl—“here,” and she thrust the
packet into my hands, with a little blushing half-impudent look at me.
I forgot all about her in a few minutes. My heart was too full of one
only other girlish figure to find room in itself for a rival. What was Zyp
doing now?—the wonderful fairy child, whose phantom presence
haunted all my dreams for good and evil.
As I walked from the office with Duke Straw that afternoon—for, as
it was Saturday, we left early—a silence fell between us till we
neared Cringle’s shop. Then, standing outside, he suddenly stayed
me and looked in my face.
“Shall I hate or love you?” he said, with his mouth set grimly.
He made a gesture toward his deformed lower limbs with his
hands, and shrugged his shoulders.
“No,” he said; “what must be, must. I’ll love you!”
There was a curious, defiant sadness in his tone, but it was gone
directly. I could only stare at him in wonder.
“You’re to be my house-fellow and chum,” he said. “No, don’t
protest; I’ve settled it. We’ll arrange the rest with Cringle.”
And so I slept in a bed in London for the first time.
But the noise of a water wheel roared in my ears all night.
CHAPTER XV.
SWEET, POOR DOLLY.