Software Architecture by Example: Using C# and .NET 1st Edition Paul Michaels pdf download
Software Architecture by Example: Using C# and .NET 1st Edition Paul Michaels pdf download
https://ebookmeta.com/product/software-architecture-by-example-
using-c-and-net-1st-edition-paul-michaels/
https://ebookmeta.com/product/software-architecture-by-example-
using-c-and-net-1st-edition-paul-michaels/
https://ebookmeta.com/product/software-architecture-
with-c-10-and-net-6-third-edition-gabriel-baptista/
https://ebookmeta.com/product/introducing-net-maui-build-and-
deploy-cross-platform-applications-using-c-and-net-multi-
platform-app-ui-1st-edition-shaun-lawrence/
https://ebookmeta.com/product/cezanne-a-life-alex-danchev/
Rethinking Mythogeography In Northfield Minnesota 1st
Edition Phil Smith John Schott
https://ebookmeta.com/product/rethinking-mythogeography-in-
northfield-minnesota-1st-edition-phil-smith-john-schott/
https://ebookmeta.com/product/kumi-kata-from-dojo-to-high-level-
competition-1-edition-edition-attilio-sacripanti/
https://ebookmeta.com/product/aiduel-s-sin-daniel-t-jackson/
https://ebookmeta.com/product/zoo-and-wild-animal-dentistry-1st-
edition-peter-p-emily/
https://ebookmeta.com/product/folk-dance-and-the-creation-of-
national-identities-staging-the-folk-anthony-shay/
Visualizing Cityscapes of Classical Antiquity from
Early Modern Reconstruction Drawings to Digital 3D
Models With a Case Study from the Ancient Town of
Koroneia in Boeotia Greece 1st Edition Chiara Piccoli
https://ebookmeta.com/product/visualizing-cityscapes-of-
classical-antiquity-from-early-modern-reconstruction-drawings-to-
digital-3d-models-with-a-case-study-from-the-ancient-town-of-
koroneia-in-boeotia-greece-1st-edition-chiara-pi/
Software
Architecture
by Example
Using C# and .NET
—
Paul Michaels
Foreword by Mark Richards
Software Architecture by
Example
Using C# and .NET
Paul Michaels
Foreword by Mark Richards
Software Architecture by Example: Using C# and .NET
Paul Michaels
Derbyshire, UK
Introduction�����������������������������������������������������������������������������������������������������������xvii
Foreword����������������������������������������������������������������������������������������������������������������xxi
v
Table of Contents
Examples������������������������������������������������������������������������������������������������������������������������������������ 21
External APIs�������������������������������������������������������������������������������������������������������������������������� 21
Getting Ticket Availability������������������������������������������������������������������������������������������������������ 21
Ordering a Ticket������������������������������������������������������������������������������������������������������������������� 25
Summary������������������������������������������������������������������������������������������������������������������������������������ 29
vi
Table of Contents
Advanced Purchase��������������������������������������������������������������������������������������������������������������� 76
Business Decision����������������������������������������������������������������������������������������������������������������� 76
Target Architecture���������������������������������������������������������������������������������������������������������������������� 77
Stateful Service��������������������������������������������������������������������������������������������������������������������� 79
Distributed Service���������������������������������������������������������������������������������������������������������������� 79
Target Architecture Diagram�������������������������������������������������������������������������������������������������� 79
Examples������������������������������������������������������������������������������������������������������������������������������������ 80
Project Structure������������������������������������������������������������������������������������������������������������������� 80
Service Bus Configuration����������������������������������������������������������������������������������������������������� 82
Coordinator���������������������������������������������������������������������������������������������������������������������������� 85
Summary������������������������������������������������������������������������������������������������������������������������������������ 90
vii
Table of Contents
viii
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 205
ix
About the Author
Paul Michaels is the Head of Development at musicMagpie.
He started his career as a professional software engineer
in 1997. Paul is a regular speaker, published author, and
Microsoft MVP. He enjoys programming, playing with new
technology, and finding neat solutions to problems. When
he’s not working, you can find him cycling or walking around
the Peak District, playing table tennis, or trying to cook for
his wife and two children. You can follow him on Twitter at
@paul_michaels or find him on LinkedIn. He also writes a
blog at http://pmichaels.net.
xi
About the Technical Reviewer
Kasam Shaikh is an Azure AI enthusiast, published author,
global speaker, community MVP, and Microsoft Docs
contributor. He has more than 14 years of experience in
the IT industry and is a regular speaker at various meetups,
online communities, and international conferences on Azure
and AI. He is currently working as Senior Cloud Architect for
a multinational firm where he leads multiple programs in the
Practice for Microsoft Cloud Platform and Low Code. He is
also a founder of the community named Dear Azure-Azure
INDIA (az-India) and leads the community for learning
Microsoft Azure. He owns a YouTube channel and website
and shares his experiences over his website
(www.kasamshaikh.com).
xiii
Acknowledgments
For this book, I have an absolute phone book of people to thank for their help.
Firstly, I have to thank my daughter, Abi, for all the artwork in the book.
Special thanks to Ash Burgess and Kevin Smith for putting up with impromptu
requests for a discussion or a review of an idea, and for Kev’s painstaking and repeated
explanations of event sourcing.
Thanks to Ian Curtis for reviewing my architectural diagram, and to James Little for
making me think so hard about architecture that a book seemed a good idea.
The travel industry is very complex, and I don’t think I could have landed in a better
place, where I had the expertise and advice of both David Hilton and Jagdip Ajimal.
When it came to containers, I found that what I was trying to do kept throwing up
roadblocks until Rob Richardson generously offered his time and expertise.
The examples in this book are based on my time working across industries and trying
to solve problems. I’ve been fortunate in my career to work with a number of very clever
and talented people. There are probably too many of these to mention, and while they
may not have directly helped with this book, I’d like to acknowledge their contribution.
Finally, I’d like to thank the team at Apress – especially Shrikant for dealing with the
various twists and turns that the book, and my life, has taken during its creation, and
Smriti for bringing me onto Apress in the first place.
xv
Introduction
All the code in this book is available from the following GitHub repo:
https://github.com/Apress/software-architecture-by-example
Should you choose to follow along and create the solution for each chapter, it may be
helpful to have a clone of the code available for reference.
T echnology
Let’s quickly discuss the specific technologies that we’re going to choose and why.
Firstly, I will use Visual Studio to write all of the code samples in this book. You can
download the community edition of this here:
https://visualstudio.microsoft.com/vs/community/
You may also wish to use VS Code, which can be found here:
https://code.visualstudio.com/download
All of the applications that we create will be in .Net and written in C#. This choice
I made simply because it’s the language that I’m most familiar with; however, I don’t
believe there’s anything in here that couldn’t be translated to any other modern OO
development language; after all, architecture should be language agnostic. Most of the
principles are broader than a specific language and could apply to any language capable
of making HTTP calls.
xvii
Introduction
S
etup
In this section, we’ll cover the basic setup that you’ll need to follow along with the code
samples. However, since this is predominantly a book on architecture, you should be
able to translate the concepts to any language.
Let’s cover a basic setup for those readers that wish to follow along.
T erminal
If you choose to use VS Code, you have a terminal built in; however, there are other
options.
Since you’re likely to be using Git, you can easily use git bash for the terminal
commands; you can download git for windows here:
https://gitforwindows.org/
Another possibility if you’re on Windows is the new (at least at the time of writing)
Microsoft Terminal. This can be found here:
https://aka.ms/terminal
Note This is, in fact, an open source product; you can find the source code for
it here:
https://github.com/Microsoft/Terminal
E xamples
The title of this book is Software Architecture by Example, so it will not surprise you to
learn that there are examples in each chapter. The purpose is to propose a problem,
suggest one or more solutions, and provide an example of how that solution might work
in reality.
What this doesn’t mean is that contained within the pages of this book are full,
complete, solutions to each problem. To illustrate my point by example, for the first
chapter, we address the problem of a business that sells tickets for concerts and festivals.
xviii
Introduction
In that chapter, there are code samples that will compile and run, but those samples are
for illustration purposes; there’s no website there, but I’ve made sure that each element
of the system is there by proxy – so the website will be simulated by a console app.
https://github.com/Apress/software-architecture-by-example
You can choose to follow along and recreate the examples, or you can clone the
repo and simply view the code, or you may decide that you’re not interested in a specific
implementation, in which case, you can simply skip the examples altogether.
xix
Discovering Diverse Content Through
Random Scribd Documents
covering army occupied a strong position, with its right at the Abbey
of St. Denis, and its left at Mamoy St. Pierre. The Prince of Orange
assembled his army, and after advancing several stages, he
encamped near the little river Senne, about seven miles from Mons;
and on the morning of the 14th of August, 1678, his Highness put
the troops in motion to attack the enemy.
The British Brigade, led by the Earl of Ossory, moved from its
camp along a difficult tract of country, until it came in front of a hill
occupied by the enemy's left wing, where it was destined to make its
attack, in conjunction with the Dutch Foot Guards. The signal for the
attack was given, when the British Grenadiers, springing forward
with lighted matches, threw a shower of hand-grenades, which,
bursting amongst the ranks of the enemy, did much execution. The
Musqueteers followed, and opening a sharp fire, were answered by
the volleys of the enemy; their fire was soon succeeded by the
charge of the Pikemen, who went cheering onward to the attack,
while the Musqueteers, drawing their swords, joined in the onset
with admirable spirit and resolution,—and the enemy gave way. One
attack was succeeded by another; the French, driven from field to
field, still rallied and returned to the fight. Pike to pike and sword to
sword, the combatants maintained a fierce conflict, while the hand-
grenades flew in every direction, and the heights of Castehau
presented a varied scene of turmoil and slaughter, in the midst of
which the Prince of Orange and the Duke of Monmouth appeared,
mixed with the combatants, and urging forward the storm of battle.
[5] A French captain levelled his pistol at the Prince, but General
D'Auverquerque killed the captain before he had time to fire, and
thus saved his Highness's life, for which service the States made him
a present of a valuable sword. Night at length put an end to the
fight, and the French afterwards made a precipitate retreat.
The regiment lost in this action Lieutenant-Colonel Archer,
Lieutenant Charlton, and about fifty men killed: also Major Hales,
Captain Charlton, Captain Coleman, Captain Floyd, Captain Dupuy,
Lieutenant Augerne, Lieutenant Marchany, Lieutenant Wilson, Ensign
Barnwell, Ensign Arnesby, and upwards of a hundred men wounded.
The loss in the other regiments of the Brigade was also equally
great.
In the mean time preliminary articles for a treaty of peace had
been agreed upon at Nimeguen; a cessation of hostilities took place
on the day after the battle; and the Brigade, after encamping a few
months in Flanders, marched to Holland, where it received the
thanks of the States-General for its meritorious services.
The restoration of peace was followed by a reduction in the
numbers of the Dutch Army; but the Prince of Orange, and the
States-General of the United Provinces, were so sensible of the
advantages they had derived from the services of the British troops,
that they were desirous of retaining the six regiments in their
service. A new treaty was concluded on this subject, and the States
agreed to send the regiments to England, whenever the King
required them to do so.
1679
1680
1684
1685
In the succeeding year the death of King Charles II. and the
accession of James II., a professed Papist, being followed by a
rebellion in Scotland, headed by the Earl of Argyle, and another in
England, headed by the Duke of Monmouth, the six British regiments
were applied for by the King, and they were accordingly embarked
for England under the command of the following officers:—
Colonel Thomas Monk,—now Fifth Foot.
{
Three English
Colonel Sir Henry Bellasis,—now Sixth Foot.
Regiments.
Colonel Alexander Cannon,—afterwards disbanded.
Colonel Kirkpatrick.
{
Three Scots
Colonel Sir Alexander Colyear.
Regiments.
Colonel Hugh Mackay.
The three Scots regiments were, in the first instance, ordered for
Scotland, but the rebellion in the North having been suppressed,
they landed at Gravesend on the 30th of June, 1685, and having
been reviewed on Blackheath by the King, marched through London
towards the West.[6] The three English regiments landed a few days
afterwards; but the rebel army having been defeated at Sedgemoor,
on the 6th of July, they encamped on Blackheath, and afterwards on
Hounslow Heath, where the Brigade was assembled and reviewed by
his Majesty, and the efficiency, discipline, and appearance of the
several corps, excited universal admiration.[7] The rebellion having
been suppressed, the six regiments returned to Holland, and were
again employed in garrison duty. The three English regiments were
on the English establishment from the 5th of June, to the 3rd of
August, 1685, and the Scots' regiments a few days longer.
1686
1687
1688
1689
1690
In the mean time Ireland had become the seat of war, and King
James was at the head of the Roman Catholics, and a French
auxiliary force, in that kingdom, while the Duke of Schomberg
commanded the Irish Protestants and English troops; and in the
spring of 1690 the Fifth Foot was ordered thither. The regiment,
accordingly, proceeded to Bristol, where it embarked; and having
landed at Belfast on the 20th of April, marched to Lisburn, and
encamped near the banks of the Lagan until the 9th June, when it
proceeded to Armagh and erected its tents on the undulating
grounds in that neighbourhood, where an encampment was formed
of four regiments of English infantry, with three regiments of Danish
horse and eight of foot.
King William having arrived in Ireland, the regiment marched to
Dundalk, where the army was assembled; and on the 1st of July the
enemy was attacked in his position on the banks of the river Boyne.
The Fifth was in Brigadier-General Trelawny's brigade, and by its
gallant conduct it contributed to the signal victory gained on this
occasion. The enemy evacuated Dublin a few days after the battle,
when the regiment was ordered to proceed thither, and it remained
in garrison in that city during the remainder of the campaign.
1691
The regiment left Dublin in the early part of 1691, and in April it
was stationed at Mountmelick. The troops quartered in that
neighbourhood were frequently disturbed by bands of armed Roman
Catholic peasantry, called Rapparees, who concealed themselves in
the day-time, and at night prowled about the country, committing
every description of depredation: to check these proceedings, a
detachment of 200 men of the Fifth, commanded by Major Rider,
with 100 men of Lord George Hamilton's regiment, and 50 troopers
of Colonel Byerley's Horse,—now 6th Dragoon Guards,—the whole
commanded by Major Wood,[14] marched out of Mountmelick at nine
o'clock on the evening of the 4th of May, and, dividing themselves
into several small parties, they traversed the woods and bogs for
several miles, frequently encountering lurking parties of the enemy,
whom they attacked, killing seventy men and capturing a quantity of
cattle, which Major Wood sent to Mountmelick under a guard of
thirty men. The remainder continued their search until about ten
o'clock on the following day, when Major Wood, with one party of 34
horsemen, and 30 foot, discovered two battalions of the enemy's
regular army of about 400 men each, marching silently between the
wood and mountains, not far from Castle-Cuff; at the same time the
enemy espied Major Wood and his little detachment. The English,
with a noble bearing and audacity, formed up in a ploughed field to
oppose this formidable host, and the Irish instantly sent forward
their grenadiers to commence the attack, but perceiving the
undaunted countenance of the detachment, they halted at a
distance. A sharp firing was at this instant heard beyond the forest,
and Major Wood, apprehending that the party with the cattle was
attacked, proceeded to its assistance; but Lieutenant Ellis and the
thirty foot, behaved like valiant men; and, having repulsed a superior
force, effected their retreat with the booty. The firing had brought a
detachment of 80 men of the Fifth from the opposite side of the
forest, and Major Wood, having now 34 horsemen and 110 foot with
him, resolved, notwithstanding the disparity of numbers, to attack
the enemy's column. He accordingly divided his foot into two parties,
and directed them to attack the enemy in front, while he himself
with the horse made a short compass to gain the enemy's rear. This
gallant little band, advancing boldly against the enemy's masses,
commenced the attack with a fury and resolution which the Irish
could not withstand, and they attempted to retreat; but at that
moment Major Wood with his thirty-four troopers came galloping
from amongst the trees and charged the flank of the column with
admirable courage and resolution; the heavy horse, breaking
through the ranks, trampled down the Irish in a terrible manner. The
column was now become a confused rabble, scattered in wild
disorder, and cut down by the English horsemen on every side; while
the English foot, slinging their muskets and drawing their swords,
joined in the pursuit and chased the enemy a considerable distance.
One hundred and fifty of the Irish were killed on the spot; and 1
major, 5 captains, 9 lieutenants, 2 ensigns, 1 adjutant, 1 surgeon, 6
serjeants, 17 corporals, 3 drummers, and 82 private men, were
made prisoners; 150 muskets were also collected, which the Irish
had thrown away to facilitate their flight. "And all this was done by
110 of our foot and 34 horse. With the foot were Major Rider,
Captain Nenny, Captain Dixey, Lieutenant Barton, and Ensign Russel.
With the horse, were Cornet Jocelyn, Cornet Hasleton, and Adjutant
Robinson, with Quarter-masters Davies and Cadford; who all, both
horse and foot, behaved extremely well, and with the loss only of
one corporal killed, and Adjutant Robinson, with two foot soldiers
and one trooper, wounded[15]."
On the 12th of May, another party of the regiment was out
scouring the woods, when 18 Rapparees were killed and several
made prisoners.
In June, the Fifth advanced with the army to Athlone, and took
part in the siege, which was commenced on the 19th of that month:
on the 30th the Grenadier company formed part of the storming
party commanded by Major-General Mackay. The attack was made
at six in the evening, when the forlorn hope, consisting of Captain
Sandys, with 2 Lieutenants and 60 Grenadiers, all in armour, entered
the Shannon, which was breast high, under a sharp fire, and were
followed by the remainder of the storming party, who passed, some
at the bridge of boats, and others by planks laid across the broken
arches of the stone bridge. The party, having gained the opposite
shore, threw forward a shower of hand-grenades, which put the
Irish in confusion; then gallantly ascending the breaches forced their
way through every obstacle, and in less than half an hour were
masters of the town, with the loss of only 12 men killed, and 5
officers with 30 men wounded; but the enemy had about 500 men
killed. Colonel Lloyd was appointed Governor of Athlone, and when
the army advanced, the Fifth, and Lieutenant-General Douglas's
regiments, were left in garrison; and the battering train was left in
their charge.
After the battle of Aghrim, when the army was about to besiege
Limerick, the Fifth, and a party of Militia, were ordered to advance
with the heavy artillery; they, accordingly, left Athlone on the 12th of
August, and joined the army at Cariganless on the 16th. The siege
was commenced a few days afterwards, and the Fifth was actively
employed until the surrender of the place on the 3rd of October. This
conquest terminated the war in Ireland, and the regiment, being
immediately ordered to embark for England, landed at Highlake,
near Chester, on the 29th of December, from whence it marched to
Nottingham, Derby, and other inland towns, where it commenced
recruiting its numbers.
1692
1694
1695
1696
1697
1698
1704
1706
1707
During the early part of the war of the Spanish succession, this
regiment was stationed in Ireland; but the united English, Dutch,
and Portuguese armies having, in 1706, advanced to Madrid, the
enemy cut off their communication with Portugal; the troops retired
from Madrid to Valencia and Catalonia, and from that period their
only communication with Portugal was by sea. At the same time it
was found necessary to have a small army on the frontiers of
Portugal, and the Fifth, Twentieth, Thirty-ninth, and a newly-raised
regiment commanded by Colonel Stanwix, having been selected for
this service, sailed from Cork on the 22nd of May, 1707, and landed
at the capital of Portugal on the 8th of June[16]. This seasonable
reinforcement arriving soon after the defeat of the allied army at
Almanza, in the south-east of Spain, and at the moment when the
enemy, having captured Serpa and Moura in the Alentejo, had seized
on the bridge of Olivenza in Portuguese Estremadura, and menaced
that important place with a siege, its presence revived the drooping
spirits of the Portuguese. The four regiments, being the only British
troops in that part of the country, were disembarked with every
possible expedition, and marched to the frontiers under the
command of the Marquis de Montandre, when the enemy
immediately ceased to act on the offensive and retired[17]. The four
regiments, having halted at Estremos, a strong town of the Alentejo,
situate on an agreeable tract on the Tarra, remained in this pleasant
quarter during the summer heats, and afterwards encamped in the
fruitful valley of the Caya near Elvas, having detached parties on the
flanks to prevent the enemy making incursions into Portugal, in
which service the regiments were engaged until November, when
they went into quarters in the towns on the frontiers of Portugal.
1708
The regiment again took the field in the spring of 1708, and was
encamped at Fuente de Sapatores between Elvas and Campo Mayor.
The British division was soon afterwards increased to six regiments,
by the arrival of the Thirteenth[18] and a newly-raised regiment
(Paston's) from England; and the little army in the Alentejo was
commanded by the Marquis de Fronteira; but the characteristic
inactivity of the Portuguese occasioned the services of the Fifth to
be limited to defensive operations. It was encamped in the autumn
at Campo Mayor, and afterwards proceeded into cantonments.
1709
After moving from its quarters in the spring of 1709, the regiment
was again engaged in active operations. It was first encamped near
Estremos, from whence it proceeded on the 23rd of April to Elvas,
and was subsequently encamped with the army on the banks of the
Caya, where the Earl of Galway, who had been removed from the
army in Catalonia, appeared at the head of the British division.
On the 7th of May the French and Spaniards, commanded by the
Marquis de Bay, marched in the direction of Campo Mayor, when the
Portuguese generals, contrary to the advice of the Earl of Galway,
resolved to pass the Caya and attack the enemy. The Portuguese
cavalry and artillery took the lead, and, having passed the river and
gained the opposite heights, opened a sharp cannonade; but upon
the advance of their adversaries to charge, these squadrons faced
about and galloped out of the field, leaving their cannon behind. The
British division, arriving at the moment, repulsed the enemy; and the
leading brigade, consisting of the Thirteenth, Stanwix's, and
Galway's regiments, commanded by Brigadier-General Thomas
Pearce, charging with great fury, recaptured the Portuguese guns;
but the three regiments, pressing forward too far, were surrounded
and made prisoners, and with them Major-Generals Sankey and the
Earl of Barrymore, and Brigadier-General Thomas Pearce, fell into
the hands of the enemy[19]. At the same time the Fifth, Twentieth,
Thirty-ninth, and Lord Paston's regiments, though deserted by the
whole of the cavalry, made a determined stand, bearing the brunt of
the enemy's reiterated attacks with admirable firmness, until the
Portuguese infantry had retired; then moving to the rear in firm
array—while the balls flew thick on every side, and the Earl of
Galway's horse was shot under him,—the enemy coming on in full
career, threatening the destruction of this little band; yet, with ranks
unbroken and steady tread, these undaunted English calmly retraced
their steps—exhibiting one of the most noble spectacles of war,—and
occasionally punishing the temerity of their pursuers with a cool and
deliberate resolution which laid a thousand Spaniards dead upon the
field[20], and impressed the enemy, and also the Portuguese, with a
sense of British courage and magnanimity. Thus they effected their
retreat, with the loss of only one hundred and fifty men killed and
wounded, and passed that night at Arronches.
The Fifth acquired great honour by its signal gallantry on this
occasion. It was afterwards encamped at Elvas, was subsequently in
position on the banks of the Guadiana, and again passed the winter
in cantonments in the Alentejo.
1710
During the campaign of 1711, the Fifth formed part of the army
which assembled at Olivenza in May, and, having passed the
Guadiana by a pontoon bridge at Jerumencha, advanced against the
enemy, who took refuge under the cannon of Badajoz. The Fifth was
afterwards engaged in the capture of several small towns, and in
levying contributions in Spanish Estremadura; but the summer
passed without any occurrence of importance, excepting a discovery
made by the Earl of Portmore, who commanded the British troops in
Portugal, of a clandestine treaty in progress between the crown of
Portugal and the enemy, in which the former had agreed to separate
from the Allies; and, to give an excuse for this, a mock battle was to
have been fought, in which the British troops were to have been
sacrificed[22]. This treaty was broken off, but the British Government
soon afterwards entered into negotiations with France.
1712
1713
1726
The crown of Spain had relinquished its claim on Gibraltar with
reluctance, and having, towards the end of 1726, resolved to engage
in a war with Great Britain, a Spanish army was assembled in
Andalusia under the command of the Count de la Torres, to
commence hostilities with the siege of this desirable entrepôt to the
Mediterranean. This gave the Fifth another opportunity of signalizing
itself, and of adding to its honours already acquired,—the proud
distinction of a successful defence of this important conquest.
1727
1728
The Fifth embarked from Gibraltar on the 12th of April, 1728, and
proceeded to Ireland, in which country it remained seven years.
1732
1735
1737
1738
1752
1754
1756
1758
1759
1760
In the mean time the war was continued in Hanover and the
neighbouring States, and the Fifth, having been ordered to proceed
to Germany, embarked at Gravesend on the 12th of May, 1760, and
arrived in the Weser on the 22nd of that month. After landing near
Bremen, the regiment marched up the country, and joined the allied
army commanded by Ferdinand Duke of Brunswick, at Fritzlar in
Hesse-Cassel, on the 17th of June; when the grenadier company
was detached to form, with the grenadier companies of the other
regiments, two Battalions, which, being united in Brigade with the
Scots Highlanders, usually formed the advance-guard of the army.
The regiment, after being employed in several manœuvres,
formed part of the corps commanded by the hereditary Prince of
Brunswick, which marched on the 10th of July to take post on the
heights of Corbach; but found the ground occupied by the enemy in
force; when a sharp skirmish occurred in which the Fifth lost five
men.[23]
Towards the end of July the regiment was encamped at Kalle. At
11 o'clock on the night of the 30th of that month it marched with
the main army for Liebenau, and, having crossed the Dymel,
advanced at five on the following morning to attack the enemy in his
position on the heights of Warbourg.
The German corps and British grenadiers in advance having
commenced the action, the French retired before the English infantry
arrived. "No troops could show more eagerness than they showed.
Many of the men, from the heat of the weather, and overstraining
themselves to get on through morasses and difficult ground,
suddenly dropped down on their march.[24]" The grenadier company
of the Fifth, being in the column which commenced the attack,
highly distinguished itself[25], and had four men killed, and Captain
Ross, Lieutenant Baker, and twenty-six men, wounded.
The regiment remained for some time encamped near Warbourg;
and the grenadier company, being encamped on the heights of
Wilda, was engaged, on the night of the 5th of September, in
surprising a French force in the town of Zierenberg, which service
was performed with distinguished gallantry and success. The
grenadiers were afterwards detached to the Lower Rhine, and were
engaged in the attempt to surprise the enemy's camp at Rheinberg
on the morning of the 16th of October, when a sharp action was
fought at the Convent of Campen, in which the company of the Fifth
lost several men. In December the regiment left the camp at
Warbourg, and went into cantonments in the villages on the bank of
the Weser.
1761
1762
Having passed the winter amongst the rude peasantry of
Osnaburg, the regiment again took the field, and joined the camp on
the heights near Blumberg on the 4th of June 1762, from whence it
proceeded to Corbeke.
The enemy took post at Groebenstien, and Prince Ferdinand
formed a design of surprising them in their camp. For this purpose
the army was formed into several columns. The Fifth forming part of
the centre column, left its camp before daylight on the morning of
the 24th of June, and crossed the Dymel at Liebenau at four o'clock;
then, advancing a distance of nine miles through a rugged and
woody country, arrived in front of the enemy's camp, and
commenced a sharp fire. The French, surprised and confounded,
abandoned their camp, leaving their tents standing, and commenced
their retreat: at the same time General Stainville threw himself with
his division into the woods of Wilhelmsthal to favour the movement.
Against this division, the right column of the allies, commanded by
the Marquis of Granby, and the centre column under Prince
Ferdinand, immediately advanced.
The Fifth, commanded by Lieutenant-Colonel Thomas Marlay,
taking the lead of the centre column, threw itself into the wood, and
opened its fire with good effect; at the same time the Marquis of
Granby's column attacked the enemy's rear. The French made a
spirited resistance; but the Fifth pressed forward with a conquering
violence which overcame all opposition, while the main body
followed in full career, and the Marquis of Granby intercepting the
enemy's retreat captured many prisoners; when the remainder of
the French division (excepting two battalions that escaped) after one
fire, surrendered to the Fifth[26]. After the French had surrendered,
an officer of the Fifth regiment, who went up to receive their colours
from their standard-bearer, was shot dead upon the spot by a French
serjeant who was standing near. This circumstance might have led to
much bloodshed, but, fortunately, little confusion resulted; the
serjeant was instantly put to death, and the colours were quietly
taken possession of[27]. The loss of the regiment was Lieutenant
Robinson, killed; and 1 serjeant, and 11 men wounded; also six men
taken prisoners in the skirmish at the commencement of the action.
Its conduct on this occasion excited much admiration;—as a mark of
distinction the men were permitted to exchange their hats for the
French grenadier caps; and the regiment for many years afterwards,
wore a fusilier's cap instead of the hat then used by the infantry of
the line. In commemoration of the gallantry displayed by the Fifth
Regiment on this occasion, his Majesty King William IV. was
graciously pleased, in 1836, to authorize the regiment to bear the
word 'Wilhelmsthal' on its Colours and Appointments.
After the action the Fifth encamped on the heights of
Wilhelmsthal; it was subsequently employed in several operations;
and on the 23rd of July, the grenadier company was engaged in a
gallant affair at Lutterberg, when the Saxons under Prince Xavier
were driven from their post and thirteen pieces of ordnance were
captured. On the 24th of the same month one hundred men of the
regiment were engaged with other corps in dislodging a detachment
of the enemy from the heights of Homburg. The regiment was
subsequently employed in operations on the Ohm, and the Lahn,
and in several skirmishes in which it lost many men. It also formed
part of the covering army during the siege of Cassel, which was
terminated by the surrender of the place on the 1st of November.
Shortly afterwards a suspension of hostilities took place; which was
followed by a treaty of peace, concluded at Fontainbleau, and the
regiment was ordered to return to England.
1763
The regiment passed the next ten years in Ireland, and was so
remarkable for its cleanliness and attention to dress and
appointments, that the men were usually called "The Shiners."
1767
1771
1772
1774
1775
1777