Test Drive ASP NET MVC 1st Edition Jonathan Mccracken Download PDF
Test Drive ASP NET MVC 1st Edition Jonathan Mccracken Download PDF
Test Drive ASP NET MVC 1st Edition Jonathan Mccracken Download PDF
com
https://ebookmeta.com/product/test-drive-asp-net-
mvc-1st-edition-jonathan-mccracken/
OR CLICK BUTTON
DOWLOAD EBOOK
https://ebookmeta.com/product/test-drive-asp-net-mvc-1st-edition-
jonathan-mccracken-2/
https://ebookmeta.com/product/asp-net-core-mvc-2-0-cookbook-
effective-ways-to-build-modern-interactive-web-applications-with-
asp-net-core-mvc-2-0-1st-edition-engin-polat/
https://ebookmeta.com/product/introduction-to-the-development-of-
web-applications-using-asp-net-core-mvc-synthesis-lectures-on-
computer-science-razvan-alexandru-mezei/
https://ebookmeta.com/product/asp-net-core-security-1st-edition-
christian-wenz-2/
ASP NET Core 6 Succinctly Dirk Strauss
https://ebookmeta.com/product/asp-net-core-6-succinctly-dirk-
strauss/
https://ebookmeta.com/product/ultra-fast-asp-net-building-ultra-
fast-and-ultra-scalable-web-sites-using-asp-net-and-sql-
server-1st-edition-richard-kiessig/
https://ebookmeta.com/product/asp-net-core-in-action-second-
edition-andrew-lock/
https://ebookmeta.com/product/pro-asp-net-core-7-meap-10th-
edition-adam-freeman/
https://ebookmeta.com/product/building-asp-net-web-pages-with-
microsoft-webmatrix-1st-edition-steve-lydford/
Test-Drive ASP.NET MVC
Jonathan McCracken
Our Pragmatic courses, workshops, and other products can help you
and your team create better software and have more fun. For more
information, as well as the latest Pragmatic titles, please visit us at
http://www.pragprog.com.
Indexing:
Seth Maislin
Copy edit:
Kim Wimpsett
Layout:
Steve Peter
Production:
Janet Furlow
International:
Juliet Benda
ISBN-10: 1-934356-53-0
ISBN-13: 978-1-934356-53-1
Version: 2010-6-28
Contents
Acknowledgments
Preface
10
10
12
13
13
14
Online Resources . . . . . . . . . . . . . . . . . . . . . . . . . .
16
Fundamentals
17
18
1.1
18
1.2
Installing MVC . . . . . . . . . . . . . . . . . . . . . . . .
21
1.3
24
Test-Driven Development
31
2.1
TDD Explained . . . . . . . . . . . . . . . . . . . . . . .
31
2.2
36
II Building an Application
42
43
3.1
43
3.2
Reading Data . . . . . . . . . . . . . . . . . . . . . . . .
45
3.3
Creating a To-Do . . . . . . . . . . . . . . . . . . . . . .
56
3.4
Deleting: Creating an Action Without a View . . . . . .
62
3.5
66
CONTENTS
71
4.1
Creating Topics . . . . . . . . . . . . . . . . . . . . . . .
72
4.2
77
4.3
80
4.4
Controllers Talking to Controllers . . . . . . . . . . . .
87
93
5.1
93
5.2
Logging In . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.3
5.4
5.5
127
6.1
Making Our Site Presentable with HTML Helpers . . . 128
6.2
6.3
6.4
6.5
146
151
7.1
7.2
7.3
172
8.1
8.2
8.3
8.4
8.5
8.6
8.7
9.1
9.2
192
9.3
9.4
. . . . . . . . . . . . . 200
Report erratum
CONTENTS
9.5
9.6
228
229
245
247
Bibliography
268
Index
270
Report erratum
Acknowledgments
I’d like to thank my publishers, Dave and Andy, who not only
provided
the opportunity for me to write this book but who also have
published
Susannah!
Thanks to Clinton Begin and Mike Mason for providing role models of
how a developer at heart can turn into an author. I’d like to thank
the crew of ThoughtWorks University XII—Sumeet Moghe, Krishnan
I also had some in-depth reviewers who helped shape the code and
friend who also taught me how do debug Pascal back in the sixth
grade
and worked through the code in this book line by line; Scott Muc, a
developer whose tenacity helped give more form to Part III of the
book;
ously explaining to me why the Hadron Collider will not cause Earth
improvement.
ACKNOWLEDGMENTS
Reimer, Ravi Kumar Pasumarthy, Xingrui Pei, Jeff Cohen, Joe Poon,
My final thanks is to you, the reader, who I hope enjoys the book as
much as I enjoyed writing it. May it help you along your adventures
in
jon@nexicon.ca
Report erratum
If at first the idea is not absurd, then there is no hope for it.
Albert Einstein
Preface
features that both ASP.NET Web Forms and ASP.NET MVC work on
top
of. This supports customers’ existing needs with the older ASP.NET
Web Forms and their future needs with ASP.NET MVC. Although
Here’s what ASP.NET MVC offers that ASP.NET Web Forms doesn’t.
The Achilles’ heel of ASP.NET Web Forms is its bloated HTML. It gen-
tion. Its default view engine, which is confusingly named the Web
Forms
view engine, gives you full control over your markup. No more
strange
id tags with $ and underscores in them. This pays off when dealing
with
Testability
unit testing, it’s less obvious how to approach testing. ASP.NET MVC
solves this with a clear way to test your code. I’ll be focusing on this
point heavily throughout the book to walk you through how to write
a
tions keep you out of configuration files, and some conventions give
Extensible Architecture
1.
http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-
asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx
Report erratum
12
restrict you from extending the framework when you need to do so.
The opposite is also true: if no conventions are set, then your team
has
default view engine but makes it easy to extend or create your own.
In fact, it doesn’t come bundled with one at all. This leaves room for
you to choose the right tool for the job. In this book, you’ll be using
With TDD, you’ll spend much more time coding and much less time
The other key advantage to this method is that it helps you learn a
framework faster. Tests, when they pass, confirm that you’ve written
a bit of code correctly, and you can even dig into the tests that the
browse all of its unit tests to help you gain an even better
understand-
ing of it.
Report erratum
13
learning ASP.NET MVC, this book will be your guide on how and
what
to test.
Who Should Read This Book?
This book was written for two audiences: Microsoft developers and
practices.
to you. Almost all the code examples in this book have been written
with TDD and are explained so that you can understand both how
the
tests work and how the ASP.NET MVC code works. Also, you’ll learn
about some tools and open source projects that can save you time
when
iar, but learning the language and the framework will be your
primary
guage, each tutorial explains line by line what the code is doing and
why it is important.
MVC, all the samples in this book are written in C#. If you’re
comfort-
able reading C# and translating for yourself, then you’ll be fine using
Part III builds on the same application but introduces how to work
with
Report erratum
14
To get the most out of this book, it’s highly recommended that you
code
through the problems while reading. Not only will this help you learn
This is a skill you’ll take with you to every language you program in.
write tests will help you write high-quality code in shorter periods of
time.
ing the framework in the 2.0 release. More evolutionary than revolu-
Html.TextBox("Name" );
This standard Html helper renders a textbox. It’s linked to the Name
property of the model so that when it’s filled out, the model itself is
Report erratum
15
Here the EditorFor( ) renders a textbox for the Person model and
checks
checking alerts you early to typos that break your code. It also helps
if you rename properties of models that are referenced in views.
EditorFor( ) can also check for all the properties of the Person and
render them all for editing. In this case, the lambda expression we
pass is the
whole model, not just a single property. You’ll get to use the
DisplayFor( ) helper methods in Section 1.3, MVC in Five Minutes:
Building Quote-OMatic, on page 24.
Templated Views
do. With ASP.NET MVC 2.0, you can now create generic view
templates
that let you postpone customizing views. This works well for
prototyping
MVC can fall back on your templated views. You’ll look at this feature
Data Annotations
rules. For example, if you wanted to make sure that a user’s name
was
five, and the ErrorMessage value will be the message you display to
the
user if they input a name that is too long or short. You’ll see more of
Other Features
Areas, asynchronous controllers, and Html.RenderAction( ) are other
use-
Report erratum
ONLINE RESOURCES
16
web applications (see Phil Haack’s blog2 for a tutorial on how to use
Online Resources
• You’ll find the source code for all the snippets used in this book,
including the full codebase for the sample application from Parts
II and III. You can find the final solution in the GetOrganizedFinal
folder when you unzip it.
• You’ll find an errata page, where you can post errors you find in
In addition, once you get to the end of the book, Section 12.3,
That’s All, Folks, on page 267 will give you some additional online
resources to sites where you can further your learning.
Feel free to use the source code in your own applications. However,
keep in mind that not all the examples in the book are fit for
production code, because some are there to help you learn only. If
you’re reading
the ebook version of this book, you can download and play with the
code by clicking the little gray rectangle before the code listings.
2.
http://haacked.com/archive/2010/01/12/ambiguous-controller-
names.aspx
Report erratum
Part I
Fundamentals
William James
Chapter 1
Getting Started
In this chapter, you’ll get your feet wet by exploring the basics of the
ASP.NET MVC framework. You’ll find out how ASP.NET MVC works
MVC and the related software you’ll need for the rest of the book.
Finally, you’ll get hands-on and build a single page web application
called Quote-O-Matic.
development tool.
1.1 How ASP.NET MVC Works
When people reference the acronym MVC, they are most likely
referring
face design pattern that separates display, data, and flow of control
acts to coordinate the input/output from the view, and the model is
the
data structure that is passed between the two. The pattern helps
sepa-
Joe Asks. . .
marily with objects. Popular open source ORMs for .NET include
easily work with MVC. In this book, we’ll use NHibernate since
changes to the model and selects a view to display. The model for
the
example is the ShoppingCart itself, and it contains information about
stuff you’d like to buy. The view then renders with the contents of
the model. In ASP.NET MVC, views are .aspx pages that contain
HTML
markup mixed with server-side coding. For our example, the default
we’ll implement this basic flow for a sample application. Refer to Fig-
ure 1.1, on the following page, which shows a typical MVC flow
working together as a user visits the Quote-O-Matic home page.
From here on, we’ll use the short form MVC to refer to ASP.NET MVC
for the rest of the book. If we need to talk about the design pattern
ASP.NET MVC.
First, the user types a URL into the browser and hits the Enter key.
This creates a request to the web server that invokes the HomeCon-
troller’s default action, Index( ). The controller then calls the logic
within
Report erratum
20
! User Types in
URL
Index.aspx
(View)
% Renders
Home Controller
Quote Page
Random
Quote
Quote
# Sends Information
(Model)
Back to Controller
the Quote class, which is the model in this example. The Quote will
return a random quote to the HomeController. Finally, the controller
ren-
ders the default view, which is the Index.aspx file. The user sees the
page display in the browser.
For those familiar with ASP.NET Web Forms, there is a small learn-
ing curve when it comes to the way the programming model works
in
MVC. For example, ASP.NET Web Forms tries to mask the fact that
view state. MVC gets rid of view state and employs a more stateless
architecture.
Report erratum
INSTALLING MVC
21
MVC on the Web
project, which also uses the MVC design pattern.∗ ASP.NET MVC
layer options, and has official Microsoft support. Phil Haack (the
guy who helped prototype ASP.NET MVC) and his team have
∗.
http://www.castleproject.org/MonoRail/
king lear.
“I was born this day fourscore and five years ago,” said Dragon.
“It’s a great age, bairns, and what few folk live to see; and for every
appearance that’s visible to me, I may live ither ten, Missie, and
never ane be a prin the waur. I would like grand mysel to make out
the hunder years, and it would be a credit to the place, and to a’
belonging till’t; and naebody wishes ill to me nor envies me for my
lang life. Just you look at that arm, Missie; it’s a strong arm for a man
o’ eighty-five.”
And Dragon stretched out his long thin arm, and snapt the curved
brown fingers—poor old Dragon! Not a child in Maidlin Cross but
could have overcome the decayed power which once had knit those
loose joints, and made them a strong man’s arm; but Dragon waved
it in the air exultingly, and was proud of his age and strength, and
repeated again with earnestness: “But I would like grand to make out
the hunder year.”
Lettie, now a tall girl of fifteen, stood by Dragon’s stair, arranging
flowers, a great number of which lay before her on one of the steps.
They were all wild flowers, of faint soft colour and sweet odours, and
Lettie was blending hawthorn and primroses, violets and cowslips,
with green sprigs of the sweetbriar, and here and there an early half-
opened wild rose—blending them with the greatest care and
devotion; while Katie Calder, developed into a stout little comely
woman-like figure, stood by, looking on with half contempt; for Katie
already had made a superb bouquet of garden flowers, and was
carrying it reverentially in her apron.
“It’s five years this day since Mr. Hairy came first to Allenders”,
continued the old man, “and it’s mair than three since they laid him in
his grave. The like o’ him—a young lad! and just to look at the like o’
me!”
“But it was God’s pleasure, Dragon,” said Lettie, pausing in her
occupation, while the shadow which stole over her face bore witness
that Harry’s memory had not passed away even from her girl’s heart.
“Ay, Missie,” said the old man vacantly; “do ye think the spirit gaed
willingly away? I’ve thought upon that mony a time when I was able
to daunder up bye to the road, and see the farm; and it’s my belief
that Mr. Hairy will never get right rest till a’s done of the guid he
wanted to do, and a’s undone o’ the ill he did—that’s my belief. I
think myself he canna get lying quiet in his grave for minding of the
work he left to do; and if there was ane here skilled to discern spirits,
he might be kent in the fields. What makes the lady sae constant at
it, think ye, night and morning, putting to her ain hand to make the
issue speedier, if it’s no that she kens about him that’s aye waiting,
waiting, and never can enter into his rest.”
Lettie let her flowers fall, and looked away with a mysterious glance
into the dark shade of the trees; for the vague awe of poetic
superstition was strong upon Lettie still.
“Dragon,” she said in a very low voice, “I used to think I heard Harry
speak, crying on me, and his footstep in his own room, and on the
stair; and all the rest thought that too, for I have seen them start and
listen many a time, thinking it was Harry. Do ye think it could be true?
Do ye think, Dragon, it could be Harry? for I came to think it was just
because he was aye in our mind that we fancied every sound was
him.”
“Ane can never answer for the dead,” said the poor old Dragon.
“Ane kens when a living person speaks, for ye can aye pit out your
hand and touch them, and see that they’re by your side; but I pit out
my hand here, Missie—it’s a’ clear air to me—but for aught I ken, an
angel in white raiment may be standing on my stair-head, and
anither within my door, laying a mark in the Book yonder that I may
open it the night at ae special verse, and read that and nae ither.
How is the like o’ me to ken? And you’ll no tell me that Mr. Hairy
winna stand by the bride the morn, and be the first voice to wish her
joy, though we may ne’er hear what he says.”
With a slight tremble, Violet, putting away her flowers, leaned upon
the step, and looked again into the darkening shadow of the trees;
and Lettie tried to think, and to pray in her simplicity that her eyes
might be opened to discern the spirits, and that she might see Harry,
if he were here. But again the mortal shrank from the visible
immortality, and Lettie covered her eyes with a thrill of visionary fear.
“Dragon, look at Lettie’s flowers,” said Katie Calder; “she wants to
put them on the table, where the minister’s to stand, instead of all
the grand ones out of Lady Dunlop’s; and I never saw such grand
flowers as Lady Dunlop’s, Dragon.”
“The dew never falls on them,” said Lettie, starting to return to her
occupation; “and if you were in the room in the dark, you would
never know they were there; but I gathered this by the Lady’s Well,
and this was growing at the foot of the stone where Lady Violet sat,
and the brier and the hawthorn out of that grand hedge, Dragon,
where a’ the flowers are; and if I put them on the table in the dark,
the wee fairy that Dragon kens, will tell the whole house they’re
there; but Lady Dunlop’s have no breath—and mine are far liker
Rose.”
As Lettie speaks, some one puts a hand over her shoulder, and
lifting her flowers, raises them up very close to a glowing radiant
face; and Dragon, hastily getting up from the easy-chair on his stair-
head, jerks his dangling right arm upward towards the brim of the low
rusty old hat, which he wears always. It is only persons of great
distinction whom Dragon so far honours, and Dragon has forgotten
“yon birkie,” in his excited glee about the approaching wedding, and
his respect for the “groom.”
“Very right, Lettie,” said the bridegroom, with a little laugh which has
a tremble in it; “they are far liker Rose. And will you be able to come
to the gate to-morrow, Dragon, and see me carry the flower of
Allenders away?”
“But ye see, my man,” said Dragon, eagerly, shuffling about his little
platform, as he looked down on Cuthbert, “I never had her about me
or among my hands, when she was a little bairn; and if it was either
Missie there, or the ither ane, I would have a greater miss; for I’ve
gotten into a way o’ telling them stories, and gieing a word of advice
to the bit things, and training them the way they should go; so they’re
turned just like bairns o’ my ain. But I wish Miss Rose and you
muckle joy, and increase and prosperity, and that ye may learn godly
behaviour, and be douce heads of a family; and that’s the warst wish
that’s in my head, though you are taking ane of the family away, and
I never was married mysel.”
And Cuthbert, responding with another joyous laugh, shook hands
with Dragon, after a manner somewhat exhausting to the loose arm,
of whose strength the old man had boasted, and immediately went
away to the waterside, to take a meditative walk along its banks, and
smile at himself for his own exuberant boyish joy. Serious and
solemn had been many of the past occasions on which he had
visited Allenders; and now, as the fulfilment of all his old anticipations
approached so certainly, so close at hand, Cuthbert’s moved heart
turned to Harry—poor Harry! whose very name had a charm in it of
mournful devotion and love!
The sun shone in next morning gaily to the rooms of Allenders, now
suddenly awakened as out of a three years’ sleep; and Agnes curls
her bright hair, and lets the sunshine glow upon it as she winds it
round her fingers, and with a sigh, lays away the widow’s cap, which
would not be suitable, she thinks, on Rose’s wedding-day; but the
sigh is a long-drawn breath of relief—and with an innocent
satisfaction, Agnes, blooming and youthful still, sees her pretty curls
fall again upon her cheek, and puts on her new white gown. It is a
pleasant sensation, and her heart rises unawares, though this other
sigh parts her lips. Poor Harry! his little wife will think of him to-day!
Think and weep, but only with a serene and gentle melancholy; for
the young joyous nature has long been rising; and Agnes, though
she never can forget, laments no longer with the reality of present
grief. It is no longer present—it is past, and only exists in
remembrance; and Agnes is involuntarily glad, and will wear her
widow’s cap no more.
And Martha is dressing little Harry, who will not be quiet in her
hands for two minutes at a time, but dances about with a perpetual
elasticity, which much retards his toilet. There are smiles on Martha’s
face—grave, quiet smiles—for she too has been thinking, with a few
tears this morning, that Harry will be at the bride’s side, to join in the
blessing with which she sends her other child away.
And Rose, in her own chamber, in a misty and bewildered
confusion, seeing nothing distinctly either before or behind her, turns
back at last to that one solemn fact, which never changes, and
remembers Harry—remembers Harry, and weeps, out of a free heart
which carries no burden into the unknown future, some sweet
pensive tears for him and for the home she is to leave to-day; and so
sits down in her bewilderment to wait for Martha’s summons, calling
her to meet the great hour whose shadow lies between her and the
skies.
And Lettie’s flowers are on the table, breathing sweet, hopeful
odours over the bridegroom and the bride. And Lettie, absorbed and
silent, listens with a beating heart for some sign that Harry is here,
and starts with a thrill of recognition when her heart imagines a
passing sigh. Poor Harry! if he is not permitted to stand unseen
among them, and witness this solemnity, he is present in their
hearts.
CHAPTER XXII.
faery queen.
Agnes, with her relieved and lightened spirits, goes cheerfully
about her domestic business now, and has learned to drive the little
old gig, and sometimes ventures as far as Stirling to make a
purchase, and begins to grow a little less afraid of spending money.
For some time now, Agnes has given up the “opening”—given it up
at Martha’s special desire, and with very little reluctance, and no one
does “opening” now at Allenders, except sometimes Martha herself,
in her own room, when she is alone. These three years have paid
Miss Jean’s thousand pounds, and one of Macalister’s four, and Mr.
Macalister is very happy to leave the rest with Miss Allenders, who,
when her fourth harvest comes, has promised to herself to pay Mr.
Buchanan. For assiduous work, and Martha’s almost stern economy,
have done wonders in these years; and the bold Armstrong boasts of
his crops, and his cattle now, and is sometimes almost inclined to
weep with Alexander, that there is no more unfruitful land to
subjugate and reclaim.
But before her fourth harvest time, Martha has intimated to Sir John
Dunlop’s factor that it was her brother’s intention to make an offer for
the little farm of Oatlands, now again tenantless, and Armstrong
does not long weep over his fully attained success; though Oatlands
has little reformation to do, compared with Allender Mains. And
Harry’s model houses are rising at Maidlin Cross; sagacious people
shake their heads, and say Miss Allenders is going too far, and is not
prudent. She is not prudent, it is very true—she ventures to the very
edge and utmost extent of lawful limits—but she has never ventured
beyond that yet, nor ever failed.
And Harry’s name and remembrance lives—strangely exists and
acts in the country in which Harry himself was little more than a
subject for gossip. To hear him spoken of now, you would rather
think of some mysterious unseen person, carrying on a great work
by means of agents, that his chosen privacy and retirement may be
kept sacred, than of one dead to all the business and labour of this
world; and there is a certain mystery and awe about the very house
where Harry’s intentions reign supreme, to be considered before
everything else. So strong is this feeling, that sometimes an ignorant
mind conceives the idea that he lives there yet in perpetual secrecy,
and by and bye will re-appear to reap the fruit of all these labours;
and Geordie Paxton shakes his head solemnly, and tells his
neighbours what the “auld man” says—that Allenders cannot rest in
his grave till this work he began is accomplished; and people speak
of Harry as an active, existing spirit—never as the dead.
It is more than a year now since Rose’s marriage, and not far from
five since Harry’s death, and there is a full family circle round the
drawing-room fireside, where Mrs. Charteris has been administering
a lively little sermon to Lettie about the extravagance of destroying
certain strips of French cambric; (“It would have cost five-and-twenty
shillings a yard in my young days,” says the old lady), with which
Lettie has been devising some piece of ornamental work for the
adornment of Agnes. But Lettie’s execution never comes up to her
ideal, and the cambric is destroyed for ever; though Katie Calder,
looking on, has made one or two suggestions which might have
saved it.
“For you see, my dear, this is waste,” said Mrs. Charteris; “and ye
should have tried it on paper first, before you touched the cambric.”
“So I did,” said Lettie, nervously; “but it went all wrong.”
And Rose smiles at the childish answer; and Mrs. Charteris bids
Violet sit erect, and keep up her head. Agnes is preparing tea at the
table. Martha, with little Sandy kneeling on the rug before her,
playing with a box of toys which he places in her lap, sits quietly
without her work, in honour of the family party; and Uncle Sandy is
telling Katie Calder all kinds of news about her companions in Ayr.
Why is Lettie nervous? Cuthbert at the table is looking over a new
magazine, which has just been brought in from Stirling with a supply
of other books ordered by their good brother; and constant longing
glances to this magazine have had some share in the destruction of
Lettie’s cambric. But Lettie is sixteen now, and Agnes thinks she
should not be such a child.
“Here is something for you,” says Cuthbert, suddenly. “Listen, we
have got a poet among us. I will read you the ballad of the ‘Lady’s
Well.’”
But Lettie, growing red and pale, dropping the paper pattern which
Mrs. Charteris has cut for her, and casting sidelong, furtive glances
round upon them all from under her drooped eyelids, trembles
nervously, and can scarcely keep her seat. When Cuthbert comes to
the end there is a momentary silence, and Martha looks with wonder
on her little sister, and Agnes exclaims in praise of the ballad, and
wonders who can possibly know the story so well. Then follows a
very free discussion on the subject, and some criticism from
Cuthbert; and then Martha suddenly asks: “It is your story, Lettie,
and you don’t often show so little interest. How do you like it? Tell
us.”
“I—I canna tell,” said Lettie, letting all her bits of cambric fall, and
drooping her face, and returning unconsciously to her childish
tongue; “for—it was me that wrote it, Martha.”
And Lettie slid down off her chair to the carpet, and concealed the
coming tears, and the agitated troubled pleasure, which did not quite
realize yet whether this was pain or joy, on Martha’s knee.
Poor Lettie! many an hour has she dreamed by the Lady’s Well—
dreamed out grand histories for “us all,” or grander still
“——Resolved
To frame she knows not what excelling thing
And win she knows not what sublime reward
Of praise and honour——”
But just now the sudden exultation bewilders Lettie; and there is
nothing she is so much inclined to do as to run away to her room in
the dark, and cry. It would be a great relief.
But the confession falls like lightning upon all the rest. Cuthbert,
with a burning face, thinks his own criticism the most stupid in the
world. Rose laughs aloud, with a pleasure which finds no other
expression so suitable. Agnes, quite startled and astonished, can do
nothing but look at the bowed head, which just now she too had
reproved for stooping. And Mrs. Charteris holds up her hands in
astonishment, and Katie claps hers, and says that she kent all the
time. But Martha, with a great flush upon her face, holds Lettie’s wet
cheeks in her hands, and bends down over her, but never says a
word. Children’s unpremeditated acts, simple words and things have
startled Martha more than once of late, as if a deeper insight had
come to her; and now there is a great motion in the heart which has
passed through tempests innumerable, and Martha cannot speak for
the thick-coming thoughts which crowd upon her mind.
That night, standing on the turret, Martha looks out upon the lands
of Allenders—the lands which her own labour has cleared of every
overpowering burden, and which the same vigorous and unwearied
faculties shall clear yet of every encumbrance, if it please God. The
moonlight glimmers over the slumbering village of Maidlin—over the
pretty houses of poor Harry’s impatient fancy, where Harry’s
labourers now dwell peacefully, and know that their improved
condition was the will and purpose of the kindly-remembered dead.
And the little spire of Maidlin Church shoots up into the sky, guarding
the rest of him, whose memory no man dares malign—whose name
has come to honour and sweet fame, since it shone upon that tablet
in the wall—and not one wish or passing project of whose mind,
which ever gained expression in words, remains without fulfilment, or
without endeavour and settled purpose to fulfil. And Martha’s
thoughts turn back—back to her own ambitious youth and its bitter
disappointment—back to the beautiful dawn of Harry’s life—to its
blight, and to its end. And this grand resurrection of her buried hopes
brings tears to Martha’s eyes, and humility to her full and swelling
heart. God, whose good pleasure it once was to put the bar of utter
powerlessness upon her ambition, has at last given her to look upon
the work of her hands—God, who did not hear, according to her
dimmed apprehension, those terrible prayers for Harry which once
wrung her very heart, gave her to see him pass away with peace and
hope at the end, and has permitted her—her, so greedy of good
fame and honour—to clear and redress his sullied name. And now
has been bestowed on Martha this child—this child, before whom
lies a gentle glory, sweet to win—a gracious, womanly, beautiful
triumph, almost worthy of an angel—and the angels know the dumb,
unspeakable humility of thanksgiving which swells in Martha’s heart.
So to all despairs, agonies, bitternesses, of the strong heart which
once stormed through them all, but which God has chastened,
exercised, at length blessed, comes this end. Harvest and seedtime
in one combination—hopes realized, and hopes to come; and all her
children under this quiet roof, sleeping the sleep of calm, untroubled
rest—all giving thanks evening and morning for fair days sent to
them out of the heavens, and sorrow charmed into sweet repose,
and danger kept away. But though Martha’s eyes are blind with
tears, and her heart calls upon Harry—Harry, safe in the strong hand
of the Father, where temptation and sorrow can reach him never
more—the same heart rises up in the great strength of joy and faith,
and blesses God: Who knoweth the beginning from the end—who
maketh His highway through the flood and the flame—His highway
still, terrible though it be—who conducts into the pleasant places,
and refreshes the failing heart with hope; and the sleep which He
gives to His beloved, fell sweet and deep that night upon the wearied
heart of Martha Muir.
the end.
LONDON:
Printed by Schulze and Co., 13, Poland Street.
Corrections
The first line indicates the original, the second the correction.
p. 90
p. 115
that is my concern—your’s is
that is my concern—yours is
p. 239
p. 275
p. 287
Erratum