Design Patterns in .NET 6: Reusable Approaches in C# and F# for Object-Oriented Software Design 3rd Edition Dmitri Nesteruk 2024 scribd download
Design Patterns in .NET 6: Reusable Approaches in C# and F# for Object-Oriented Software Design 3rd Edition Dmitri Nesteruk 2024 scribd download
com
https://ebookmeta.com/product/design-patterns-in-
net-6-reusable-approaches-in-c-and-f-for-object-oriented-
software-design-3rd-edition-dmitri-nesteruk/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookmeta.com/product/get-in-my-swamp-an-ogre-love-story-g-m-
fairy/
ebookmeta.com
Litt's Drug Eruption & Reaction Manual, 28th Edition Neil
H. Shear
https://ebookmeta.com/product/litts-drug-eruption-reaction-
manual-28th-edition-neil-h-shear/
ebookmeta.com
https://ebookmeta.com/product/the-eye-of-the-crown-routledge-research-
in-early-modern-history-1st-edition-kristin-m-s-bezio/
ebookmeta.com
https://ebookmeta.com/product/the-magnificent-mountain-women-
adventures-in-the-colorado-rockies-2nd-edition-janet-robertson/
ebookmeta.com
https://ebookmeta.com/product/hard-on-the-boss-1st-edition-tarin-lex/
ebookmeta.com
https://ebookmeta.com/product/novel-engineering-k-8-an-integrated-
approach-to-engineering-and-literacy-1st-edition-elissa-milto/
ebookmeta.com
Alternative Societies For a Pluralist Socialism 1st
Edition Luke Martell
https://ebookmeta.com/product/alternative-societies-for-a-pluralist-
socialism-1st-edition-luke-martell/
ebookmeta.com
Design Patterns in .NET 6
Reusable Approaches in C# and F#
for Object-Oriented Software Design
Third Edition
Dmitri Nesteruk
Design Patterns in .NET 6: Reusable Approaches in C# and F# for Object-Oriented
Software Design
Dmitri Nesteruk
St. Petersburg, c.St-Petersburg, Russia
Introduction������������������������������������������������������������������������������������������������������������xix
Part I: Introduction����������������������������������������������������������������������������������������� 1
Chapter 1: The SOLID Design Principles������������������������������������������������������������������� 3
Single Responsibility Principle������������������������������������������������������������������������������������������������������ 3
Open-Closed Principle������������������������������������������������������������������������������������������������������������������ 6
Liskov Substitution Principle������������������������������������������������������������������������������������������������������� 13
Interface Segregation Principle�������������������������������������������������������������������������������������������������� 15
Parameter Object������������������������������������������������������������������������������������������������������������������� 20
Dependency Inversion Principle�������������������������������������������������������������������������������������������������� 21
v
Table of Contents
Static Initialization���������������������������������������������������������������������������������������������������������������������� 41
Communicating Intent����������������������������������������������������������������������������������������������������������������� 42
Nested Builder and Immutability������������������������������������������������������������������������������������������������� 44
Composite Builder����������������������������������������������������������������������������������������������������������������������� 45
Builder Marker Interfaces����������������������������������������������������������������������������������������������������������� 49
Stepwise Builder (Wizard)����������������������������������������������������������������������������������������������������������� 51
Builder Parameter����������������������������������������������������������������������������������������������������������������������� 56
Builder Extension with Recursive Generics�������������������������������������������������������������������������������� 58
Lazy Functional Builder��������������������������������������������������������������������������������������������������������������� 62
Builder-Decorator������������������������������������������������������������������������������������������������������������������������ 65
Scoping Builder Method�������������������������������������������������������������������������������������������������������������� 68
DSL Construction in F#���������������������������������������������������������������������������������������������������������������� 69
Summary������������������������������������������������������������������������������������������������������������������������������������ 70
Chapter 4: Factories����������������������������������������������������������������������������������������������� 73
Scenario�������������������������������������������������������������������������������������������������������������������������������������� 73
Factory Method��������������������������������������������������������������������������������������������������������������������������� 75
Asynchronous Factory Method��������������������������������������������������������������������������������������������������� 76
Factory���������������������������������������������������������������������������������������������������������������������������������������� 77
Inner Factory������������������������������������������������������������������������������������������������������������������������������� 78
Physical Separation��������������������������������������������������������������������������������������������������������������� 79
Abstract Factory�������������������������������������������������������������������������������������������������������������������������� 79
Delegate Factories in IoC������������������������������������������������������������������������������������������������������������ 83
Object Tracking and Bulk Replacements������������������������������������������������������������������������������������� 85
Object Tracking���������������������������������������������������������������������������������������������������������������������� 85
Bulk Modifications����������������������������������������������������������������������������������������������������������������� 87
Functional Factory���������������������������������������������������������������������������������������������������������������������� 90
Summary������������������������������������������������������������������������������������������������������������������������������������ 91
vi
Table of Contents
Chapter 5: Prototype����������������������������������������������������������������������������������������������� 93
Deep vs. Shallow Copying����������������������������������������������������������������������������������������������������������� 93
ICloneable Is Bad������������������������������������������������������������������������������������������������������������������������ 94
Deep Copying via Copy Construction������������������������������������������������������������������������������������������ 96
Note on Record Classes�������������������������������������������������������������������������������������������������������������� 97
Deep Copying with a Special Interface��������������������������������������������������������������������������������������� 97
Deep Copying and Inheritance����������������������������������������������������������������������������������������������� 98
Deep Copying Guidelines���������������������������������������������������������������������������������������������������������� 102
Trivially Copyable Types������������������������������������������������������������������������������������������������������� 103
Arrays���������������������������������������������������������������������������������������������������������������������������������� 103
Common Collection Types���������������������������������������������������������������������������������������������������� 104
MemberwiseClone Is Not Terrible���������������������������������������������������������������������������������������� 105
Summary���������������������������������������������������������������������������������������������������������������������������������� 106
Serialization������������������������������������������������������������������������������������������������������������������������������ 107
Prototype Factory���������������������������������������������������������������������������������������������������������������������� 109
Source Generators�������������������������������������������������������������������������������������������������������������������� 110
Summary���������������������������������������������������������������������������������������������������������������������������������� 111
vii
Table of Contents
viii
Table of Contents
ix
Table of Contents
x
Table of Contents
xi
Table of Contents
xii
Table of Contents
xiii
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 457
xiv
About the Author
Dmitri Nesteruk is a quantitative analyst, developer, course
instructor, book author, and an occasional conference
speaker. His interests lie in software development
and integration practices in the areas of computation,
quantitative finance, and algorithmic trading. His
technological interests include C# and C++ programming
as well as high-performance computing using technologies
such as CUDA and FPGAs.
xv
Other documents randomly have
different content
and comical person of whom he writes. There is a vein of cruelty or
of selfishness in some of the others who follow one another through
his pages. The worst of them is the “phenomenally brutal”
sportsman who, along with Mr. Douglas, gave a dead rat to a sow to
eat:
G. P. PUTNAM’S SONS
❦
Complete Catalogues sent
on application
The
Art of Reading
By
Sir Arthur Quiller-Couch
8°
Editor, novelist, poet, and critic, Sir
Arthur Quiller-Couch is one of the most
versatile as well as distinguished living men
of letters. His are fresh viewpoints, opening
up ever new possibilities of appreciation for
the reader at the same time that they
educate his judgment.
G. P. Putnam’s Sons
New York London
On the Art of
Writing
By
Sir Arthur Quiller-Couch
In a fresh and untrammeled manner the
author deals with the craftsmanship as well
as the content of letters. The scope of the
volume is indicated by the appended chapter
titles: “The Practice of Writing,” “On the
Difference between Verse and Prose,”
“Interlude,” “On Jargon,” “On the Special
Difficulty of Prose,” “On the Lineage of
English Literature,” “English Literature in our
Universities.”
G. P. Putnam’s Sons
New York London
Studies in
Literature
Second Series
By
Sir Arthur Quiller-Couch
A new collection of essays which
demonstrates the author’s peculiar ability to
say something original about even the most
threadbare subject. J. C. Squire in The
Observer (London) says: “The man is rare
who, with Sir Arthur’s combination of sense
and sensibility, learning and levity, love of
the exquisite and sympathy with the normal,
can range over the whole field of ancient
and modern literature and vitalize whatever
he touches.” This volume includes essays on
Byron, Shelley, Milton, Chaucer,
Shakespeare, and “The Victorian Age.”
G. P. Putnam’s Sons
New York London
Books and Folks
By
Edward N. Teall
“Writing after having had unusual
experience with books and people, and in a
vein that is as creditable to the books as it
must be pleasing to the people, his treatise
is of great value.”
Evening Post, July 9, 1921.
“In a time when so many literary
counsellors are drawing attention to the
freakish, the rebellious writers, and to the
ones who would pioneer new styles and
methods it is refreshing to have at hand a
book that speaks lovingly for the art of
letters, the whole art, and for the individual
and unbiased appreciation.
“... The book is a most acceptable library
companion. There’s no pretense and no
posing in all of its pages.”—Oakland Tribune,
July 10, 1921.
G. P. Putnam’s Sons
New York London
Transcriber’s Notes
Punctuation, hyphenation, and spelling were made
consistent when a predominant preference was found in the
original book; otherwise they were not changed.
Simple typographical errors were corrected; unbalanced
quotation marks were remedied when the change was
obvious, and otherwise left unbalanced.
Page 139: “way-born” should be “way-worn”.
*** END OF THE PROJECT GUTENBERG EBOOK BOOKS AND
AUTHORS ***
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.