100% found this document useful (1 vote)
80 views

Full Download Design Patterns by Tutorials Learning design patterns in Swift 4 2 Joshua Greene PDF DOCX

Patterns

Uploaded by

globeleccadp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
80 views

Full Download Design Patterns by Tutorials Learning design patterns in Swift 4 2 Joshua Greene PDF DOCX

Patterns

Uploaded by

globeleccadp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Design Patterns by Tutorials Learning design


patterns in Swift 4 2 Joshua Greene

https://textbookfull.com/product/design-patterns-by-
tutorials-learning-design-patterns-in-swift-4-2-joshua-
greene/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Design Patterns by Tutorials Third Edition Learning Design


Patterns in Swift Raywenderlich Tutorial Team

https://textbookfull.com/product/design-patterns-by-tutorials-third-
edition-learning-design-patterns-in-swift-raywenderlich-tutorial-team/

textboxfull.com

Swift 2 Design Patterns 1st Edition Lange

https://textbookfull.com/product/swift-2-design-patterns-1st-edition-
lange/

textboxfull.com

Learning Python Design Patterns Second Edition Chetan


Giridhar

https://textbookfull.com/product/learning-python-design-patterns-
second-edition-chetan-giridhar/

textboxfull.com

Java Design Patterns A tour of 23 gang of four design


patterns in Java 1st Edition Vaskaran Sarcar

https://textbookfull.com/product/java-design-patterns-a-tour-
of-23-gang-of-four-design-patterns-in-java-1st-edition-vaskaran-
sarcar/
textboxfull.com
Java design patterns a tour of 23 gang of four design
patterns in Java 1st Edition Vaskaran Sarcar

https://textbookfull.com/product/java-design-patterns-a-tour-
of-23-gang-of-four-design-patterns-in-java-1st-edition-vaskaran-
sarcar-2/
textboxfull.com

iOS Test Driven Development by Tutorials First Edition


Learn Real World Test Driven Development Joshua Greene

https://textbookfull.com/product/ios-test-driven-development-by-
tutorials-first-edition-learn-real-world-test-driven-development-
joshua-greene/
textboxfull.com

API Design Patterns MEAP v07 Jj Geewax

https://textbookfull.com/product/api-design-patterns-meap-v07-jj-
geewax/

textboxfull.com

iOS 11 by Tutorials Learning the new iOS APIs with Swift 4


1st Edition The Raywenderlich Tutorial Team

https://textbookfull.com/product/ios-11-by-tutorials-learning-the-new-
ios-apis-with-swift-4-1st-edition-the-raywenderlich-tutorial-team/

textboxfull.com

Mastering PHP design patterns develop robust and reusable


code using a multitude of design patterns for PHP 7 Ali

https://textbookfull.com/product/mastering-php-design-patterns-
develop-robust-and-reusable-code-using-a-multitude-of-design-patterns-
for-php-7-ali/
textboxfull.com
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

Design Patterns by Tutorials


By Joshua Greene & Jay Strawn

Copyright ©2018 Razeware LLC.

Notice of Rights
All rights reserved. No part of this book or corresponding materials (such as text,
images, or source code) may be reproduced or distributed by any means without prior
written permission of the copyright owner.

Notice of Liability
This book and all corresponding materials (such as source code) are provided on an “as
is” basis, without warranty of any kind, express of implied, including but not limited to
the warranties of merchantability, fitness for a particular purpose, and
noninfringement. In no event shall the authors or copyright holders be liable for any
claim, damages or other liability, whether in action of contract, tort or otherwise,
arising from, out of or in connection with the software or the use of other dealing in the
software.

Trademarks
All trademarks and registered trademarks appearing in this book are the property of
their own respective owners.

raywenderlich.com 2
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

Dedications
"For my girls — Marsha, Madeline and Amelia. Thank you for your
patience and support. You mean the world to me, and I love you very
much."

— Joshua Greene

"To my friends and family, thank you for being extremely supportive
and loving while I undertook this huge endeavor. To Joshua Greene,
thank you for being a great mentor and wellspring of ideas. To the
raywenderlich.com editors and staff, thank you for your fantastic
help and hard work."

— Jay Strawn

raywenderlich.com 3
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

About the Authors


Joshua Greene is an author of this book. He is an experienced iOS
developer who loves creating elegant apps. When he's not slinging
code, he enjoys martial arts, Netflix and spending time with his
wonderful wife and two daughters. You can reach him on Twitter at
@jrg_developer.

Jay Strawn is an author of this book. She is a former librarian and is


passionate about languages both human and code based. When she's
not working as a developer, Jay enjoys being an ESL conversation
partner and reading zines.

About the Editors


Darren Ferguson is a tech editor for this book. He is an experienced
software developer and works for M.C. Dean, Inc, a systems
integration provider from North Virginia. When he's not coding, you'll
find him enjoying EPL Football, traveling as much as possible and
spending time with his wife and daughter.

Aaron Douglas is a tech editor for this book. He was that kid taking
apart the mechanical and electrical appliances at five years of age to
see how they worked. He never grew out of that core interest - to
know how things work. He took an early interest in computer
programming, figuring out how to get past security to be able to play
games on his dad's computer. He's still that feisty nerd, but at least
now he gets paid to do it. Aaron works for Automattic
(WordPress.com, WooCommerce, SimpleNote) as a Mobile Maker/
Lead primarily on the WooCommerce mobile apps. Find Aaron on
Twitter as @astralbodies or at his blog at aaron.blog.

Chris Belanger is an editor of this book. Chris is the Editor in Chief


at raywenderlich.com. He was a developer for nearly 20 years in
various fields from e-health to aerial surveillance to industrial
controls. If there are words to wrangle or a paragraph to ponder, he’s
on the case. When he kicks back, you can usually find Chris with
guitar in hand, looking for the nearest beach. Twitter: @crispytwit.

raywenderlich.com 4
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

About the Artist


Vicki Wenderlich is the designer and artist of the cover of this book.
She is Ray’s wife and business partner. She is a digital artist who
creates illustrations, game art and a lot of other art or design work for
the tutorials and books on raywenderlich.com. When she’s not
making art, she loves hiking, a good glass of wine and attempting to
create the perfect cheese plate.

raywenderlich.com 5
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

Table of Contents: Overview


Introduction ............................................................................. 14
Book License ............................................................................ 17
Book Source Code & Forums ............................................. 18
About the Cover ..................................................................... 19
Section I: Hello, Design Patterns! .................................... 20
Chapter 1: What are Design Patterns? ................. 21
Chapter 2: How to Read a Class Diagram ............ 27
Section II: Fundamental Design Patterns ..................... 37
Chapter 3: Model-View-Controller Pattern ....... 38
Chapter 4: Delegation Pattern ................................. 61
Chapter 5: Strategy Pattern ...................................... 83
Chapter 6: Singleton Pattern .................................... 96
Chapter 7: Memento Pattern ................................. 110
Chapter 8: Observer Pattern ................................. 129
Chapter 9: Builder Pattern ...................................... 143
Section III: Intermediate Design Patterns ................. 162
Chapter 10: Model-View-ViewModel Pattern 163
Chapter 11: Factory Pattern .................................. 177
Chapter 12: Adapter Pattern ................................. 185

raywenderlich.com 6
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

Chapter 13: Iterator Pattern .................................. 196


Chapter 14: Prototype Pattern ............................. 205
Chapter 15: State Pattern ....................................... 214
Chapter 16: Multicast Delegate Pattern ........... 233
Chapter 17: Facade Pattern ................................... 245
Section IV: Advanced Design Patterns ....................... 257
Chapter 18: Flyweight Pattern .............................. 258
Chapter 19: Mediator Pattern ............................... 267
Chapter 20: Composite Pattern ............................ 289
Chapter 21: Command Pattern ............................. 299
Chapter 22: Chain-of-Responsibility Pattern.. 315
Chapter 23: Coordinator Pattern ......................... 332
Conclusion .............................................................................. 358

raywenderlich.com 7
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

Table of Contents: Extended


Introduction ............................................................................. 14
About this book .................................................................................................................. 14
Chapter structure .............................................................................................................. 16
How to read this book ...................................................................................................... 16

Book License ............................................................................ 17


Book Source Code & Forums ............................................. 18
About the Cover ..................................................................... 19
Section I: Hello, Design Patterns! .................................... 20
Chapter 1: What are Design Patterns? .......................... 21
A real-world example ....................................................................................................... 22
Example explanation ........................................................................................................ 22
Types of design patterns ................................................................................................. 23
Criticisms of design patterns ........................................................................................ 24
Benefits of design patterns ............................................................................................ 25
Key points ............................................................................................................................. 26

Chapter 2: How to Read a Class Diagram..................... 27


What’s in a class diagram? .............................................................................................. 27
Challenges ............................................................................................................................ 33
Key points ............................................................................................................................. 36

Section II: Fundamental Design Patterns ..................... 37


Chapter 3: Model-View-Controller Pattern ................ 38
When should you use it? ................................................................................................. 39
Playground example ......................................................................................................... 39
What should you be careful about? ............................................................................ 43
Tutorial project ................................................................................................................... 43
Key points ............................................................................................................................. 60

raywenderlich.com 8
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

Chapter 4: Delegation Pattern ......................................... 61


When should you use it? ................................................................................................. 61
Playground example ......................................................................................................... 62
What should you be careful about? ............................................................................ 64
Tutorial project ................................................................................................................... 65
Key points ............................................................................................................................. 82

Chapter 5: Strategy Pattern............................................... 83


When should you use it? ................................................................................................. 84
Playground example ......................................................................................................... 84
What should you be careful about? ............................................................................ 86
Tutorial project ................................................................................................................... 86
Key points ............................................................................................................................. 95

Chapter 6: Singleton Pattern ............................................. 96


When should you use it? ................................................................................................. 96
Playground example ......................................................................................................... 97
What should you be careful about? ............................................................................ 99
Tutorial project ................................................................................................................ 100
Key points........................................................................................................................... 109

Chapter 7: Memento Pattern ......................................... 110


When should you use it? ............................................................................................... 110
Playground example ...................................................................................................... 111
What should you be careful about? ......................................................................... 114
Tutorial project ................................................................................................................ 115
Key points........................................................................................................................... 128

Chapter 8: Observer Pattern .......................................... 129


When should you use it? ............................................................................................... 130
Playground example ...................................................................................................... 130
What should you be careful about? ......................................................................... 138
Tutorial project ................................................................................................................ 138
Key points........................................................................................................................... 142

raywenderlich.com 9
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

Chapter 9: Builder Pattern .............................................. 143


When should you use it? ............................................................................................... 144
Playground example ...................................................................................................... 144
What should you be careful about? ......................................................................... 148
Tutorial project ................................................................................................................ 149
Key points........................................................................................................................... 161
Where to go from here?................................................................................................ 161

Section III: Intermediate Design Patterns ................. 162


Chapter 10: Model-View-ViewModel Pattern ........ 163
When should you use it? ............................................................................................... 164
Playground example ...................................................................................................... 164
What should you be careful about? ......................................................................... 169
Tutorial project ................................................................................................................ 170
Key points........................................................................................................................... 176

Chapter 11: Factory Pattern ........................................... 177


When should you use it? ............................................................................................... 178
Playground example ...................................................................................................... 178
What should you be careful about? ......................................................................... 180
Tutorial project ................................................................................................................ 181
Key points........................................................................................................................... 183

Chapter 12: Adapter Pattern .......................................... 185


When should you use it? ............................................................................................... 186
Playground example ...................................................................................................... 187
What should you be careful about? ......................................................................... 190
Tutorial project ................................................................................................................ 190
Key points........................................................................................................................... 194

Chapter 13: Iterator Pattern........................................... 196


When should you use it? ............................................................................................... 197
Playground example ...................................................................................................... 197
What should you be careful about? ......................................................................... 201

raywenderlich.com 10
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

Tutorial project ................................................................................................................ 201


Key points........................................................................................................................... 204
Where to go from here?................................................................................................ 204

Chapter 14: Prototype Pattern ...................................... 205


When should you use it? ............................................................................................... 206
Playground example ...................................................................................................... 206
What should you be careful about? ......................................................................... 209
Tutorial project ................................................................................................................ 210
Key points........................................................................................................................... 212

Chapter 15: State Pattern ................................................ 214


When should you use it? ............................................................................................... 215
Playground example ...................................................................................................... 216
What should you be careful about? ......................................................................... 224
Tutorial project ................................................................................................................ 224
Key points........................................................................................................................... 232

Chapter 16: Multicast Delegate Pattern.................... 233


When should you use it? ............................................................................................... 234
Playground example ...................................................................................................... 234
What should you be careful about? ......................................................................... 239
Tutorial project ................................................................................................................ 239
Key points........................................................................................................................... 244

Chapter 17: Facade Pattern ............................................ 245


When should you use it? ............................................................................................... 245
Playground example ...................................................................................................... 246
What should you be careful about? ......................................................................... 250
Tutorial project ................................................................................................................ 250
Key points........................................................................................................................... 256
Where to go from here?................................................................................................ 256

Section IV: Advanced Design Patterns ....................... 257


Chapter 18: Flyweight Pattern ...................................... 258

raywenderlich.com 11
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

When should you use it? ............................................................................................... 259


Playground example ...................................................................................................... 259
What should you be careful about? ......................................................................... 260
Tutorial project ................................................................................................................ 261
Key points........................................................................................................................... 265

Chapter 19: Mediator Pattern ....................................... 267


When should you use it? ............................................................................................... 268
Playground example ...................................................................................................... 268
What should you be careful about? ......................................................................... 275
Tutorial project ................................................................................................................ 275
Key points........................................................................................................................... 287
Where to go from here?................................................................................................ 287

Chapter 20: Composite Pattern .................................... 289


When should you use it? ............................................................................................... 290
Playground example ...................................................................................................... 290
What should you be careful about? ......................................................................... 293
Tutorial project ................................................................................................................ 293
Key Points .......................................................................................................................... 298

Chapter 21: Command Pattern ..................................... 299


When should you use it? ............................................................................................... 300
Playground example ...................................................................................................... 300
What should you be careful about? ......................................................................... 303
Tutorial project ................................................................................................................ 303
Key points........................................................................................................................... 313
Where to go from here?................................................................................................ 314

Chapter 22: Chain-of-Responsibility Pattern .......... 315


When should you use it? ............................................................................................... 316
Playground example ...................................................................................................... 317
What should you be careful about? ......................................................................... 325
Tutorial project ................................................................................................................ 325
Key points........................................................................................................................... 331

raywenderlich.com 12
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials

Where to go from here?................................................................................................ 331

Chapter 23: Coordinator Pattern ................................. 332


When should you use it? ............................................................................................... 333
Playground example ...................................................................................................... 333
What should you be careful about? ......................................................................... 344
Tutorial project ................................................................................................................ 344
Key points........................................................................................................................... 356
Where to go from here?................................................................................................ 357

Conclusion .............................................................................. 358


Want to Grow Your Skills? ........................................................................................... 359

raywenderlich.com 13
WOW! eBook
www.wowebook.org
I Introduction

Design Patterns: Elements of Reusable, Object-Oriented Software, the first book to ever
describe design patterns, inspired the revolutionary idea of reusable, template solutions
to common software development problems. Design patterns aren’t specific to a
particular situation, but rather, they are solutions you can adapt and use in countless
projects.

The classic text starts off with the following statement:

"Designing object-oriented software is hard."

Why should software design be hard? We’ve done everything we can to make it easy and
understandable, so anyone can learn it.

About this book


We wrote this book with two seemingly opposite goals:

1. Make as few assumptions as possible about readers’ skill levels.

2. Make this book useful for both beginning and advanced developers.

We think we’ve done it! The only requirements for reading this book are a basic
understanding of Swift and iOS development.

If you’ve worked through our classic beginner books — the Swift Apprentice https://
store.raywenderlich.com/products/swift-apprentice and the iOS Apprentice https://
store.raywenderlich.com/products/ios-apprentice — or have similar development
experience, you’re ready to read this book.

raywenderlich.com 14
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials Introduction

And if you’re an advanced developer, we also have a lot of great advanced design
patterns for you as well!

As you work through this book, you’ll progress from beginning topics to more advanced
concepts.

This book has four sections:

I. Hello, Design Patterns!


This is a high-level introduction to what design patterns are, why they’re important,
and how they will help you.

You’ll also learn how to read and use class diagrams in this section. This will make it
much easier for you to learn design patterns, so it’s important to go over this first to get
the most out of the book.

II. Fundamental Design Patterns


This section covers essential iOS design patterns. These patterns are frequently used
throughout iOS development, and every iOS developer should understand these well.

These patterns work well in combinations, so all of the chapters in this section walk you
through building a single tutorial project from the ground up.

III. Intermediate Design Patterns


This section covers design patterns that are also common, but they're used less
frequently than the fundamental design patterns in Section II.

Many of these patterns work well together, but not all. You’ll create two projects in this
section as you explore these intermediate patterns.

IV. Advanced Design Patterns


This section covers design patterns that are very useful in more rare scenarios. These
patterns may be exactly the right solution for a particular problem, but they might not
have a place in your day-to-day development. But they’re still amazing patterns that
you should keep in the back of your development toolbox!

You’ll build several tutorial projects throughout this section.

raywenderlich.com 15
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials Introduction

Chapter structure
Each design pattern chapter in Sections II through IV follow a similar structure:

• What is it?

This section gives a class diagram and explains the design pattern.

• When should you use it?

This section describes the design pattern’s strengths and provides examples where
the design pattern works well.

• Playground example

This section shows you how to use the design pattern within a playground example.
This isn’t meant to be a complete project, but rather, it’s a standalone example to
teach you the basics of the design pattern.

• What should you be careful about?

This section describes the shortcomings, weaknesses and caveats of a particular


pattern. Every pattern can be misused, so it’s best to know upfront when not to use a
pattern.

• Tutorial project

This section guides you through using the design pattern in a tutorial app.

• Key points

This section provides a summary of what you learned and key points to remember for
the chapter.

How to read this book


If you’re a beginner to iOS development or design patterns, you should read this book
from cover to cover.

If you’re an advanced developer, or already have experience with some design patterns,
you can skip from chapter to chapter or use this book as a reference. While some
tutorial projects are shared between chapters, you’ll always be provided with a starter
project in each chapter to get you up and running quickly. What’s the absolute best way
to read this book? Just start reading, wherever makes sense to you!

raywenderlich.com 16
WOW! eBook
www.wowebook.org
L Book License

By purchasing Design Patterns by Tutorials, you have the following license:

• You are allowed to use and/or modify the source code in Design Patterns by Tutorials
in as many apps as you want, with no attribution required.

• You are allowed to use and/or modify all art, images and designs that are included in
Design Patterns by Tutorials in as many apps as you want, but must include this
attribution line somewhere inside your app: “Artwork/images/designs: from Design
Patterns by Tutorials, available at www.raywenderlich.com”.

• The source code included in Design Patterns by Tutorials is for your personal use only.
You are NOT allowed to distribute or sell the source code in Design Patterns by
Tutorials without prior authorization.

• This book is for your personal use only. You are NOT allowed to sell this book
without prior authorization, or distribute it to friends, coworkers or students; they
would need to purchase their own copies.

All materials provided with this book are provided on an “as is” basis, without warranty
of any kind, express or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and noninfringement. In no event shall
the authors or copyright holders be liable for any claim, damages or other liability,
whether in an action or contract, tort or otherwise, arising from, out of or in connection
with the software or the use or other dealings in the software.

All trademarks and registered trademarks appearing in this guide are the properties of
their respective owners.

raywenderlich.com 17
WOW! eBook
www.wowebook.org
B Book Source Code &
Forums

This book comes with the source code for the starter and completed projects for each
chapter. These resources are shipped with the digital edition you downloaded from
store.raywenderlich.com.

We’ve also set up an official forum for the book at forums.raywenderlich.com. This is a
great place to ask questions about the book or to submit any errors you may find.

raywenderlich.com 18
WOW! eBook
www.wowebook.org
A About the Cover

Coral reefs contain some of the most amazing, colorful and diverse ecosystems on
Earth. Although coral reefs make up just a tiny fragment of the ocean’s underwater
area, they support over 25% of known marine life. It’s rather difficult to underestimate
the value that coral reefs add to the diversity and sustainability of our oceans.

Although reefs are highly structured, they have many variants and perform a variety of
functions. More than just pretty “rocks”, coral reefs are truly the foundation of their
surrounding ecosystems. In that way, you could consider them the “design patterns” of
the ocean!

Unfortunately, coral reefs are in dramatic decline around the world. Potentially 90% of
known coral reefs may be in serious danger in as little as ten years. Various
organizations are actively working to find ways to mitigate the issues caused from
pollution, overfishing and physical damage done to reefs. For more information, check
out the following great resources:

• https://en.wikipedia.org/wiki/Coral_reef_protection

• https://coral.org/

raywenderlich.com 19
WOW! eBook
www.wowebook.org
Section I: Hello, Design Patterns!

This is a high-level introduction to what design patterns are, why they're important,
and how they will help you.

You'll also learn how to read and use class diagrams in this section. This will make it
much easier for you to learn design patterns, so it’s important to go over this first to get
the most out of the book.

Chapter 1: What are Design Patterns?


Chapter 2: How to Read a Class Diagram

raywenderlich.com 20
WOW! eBook
www.wowebook.org
1 Chapter 1: What are Design
Patterns?
By Joshua Greene

“Extra, extra! Read all about it!”

“Feared by newcomers. Loved by architects. Read the inside story about design patterns.
The truth may surprise you!”

Did you know design patterns can make you a better developer? “Of course,” you say
— you are reading this book, after all!

Did you know design patterns can help you make more money? It’s true. You can save
time, work less and ultimately create more great things by using design patterns
correctly.

And did you know design patterns can help you fight vampires? OK, maybe not —
design patterns aren’t silver bullets, after all.

However, design patterns are incredibly useful, no matter what language or platform
you develop for, and every developer should absolutely know about them. They should
also know how and when to apply them. That's what you're going to learn in this book!

raywenderlich.com 21
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials Chapter 1: What are Design Patterns?

A real-world example
The introduction told you that design patterns are reusable, template solutions to
common development problems. Design patterns aren’t concrete implementations, but
rather, serve as starting points for writing code. They describe generic solutions to
problems that experienced developers have encountered many times before.

What does this mean exactly...? Consider this non-development, real-world scenario:

You’re the proud owner of a gardening company, and your business is really, er,
blooming. You’ve only done a few small projects up to now - a tree planted here, and
maybe a few flowers there. However, you just landed a big client who wants several
dozen trees and flowers planted on their property.

Your standard procedure has been for your employees to carry each flower or tree
sapling into place individually. Once the flower has been temporarily placed in the
flowerbed, your customer inspects and approves the arrangement before you plant
everything in the ground.

You’re worried it’s going to take forever to carry each flower and tree into place for this
large project. And you even need a few people to carry some of the bigger trees. While
you could hire lots of temporary employees, you wouldn’t make a profit on the job.
There’s got to be a better way!

You decide to ask other gardeners what they do, and you find out they use wheelbarrows
and carts. What a great idea! You tell your employees to use a cart to move multiple
flowers at the same time into place and a wheelbarrow to move the heavy trees. In the
meantime, you use a lounge chair chair to watch your workers go to it... isn’t
management great?

So now you know all about design patterns! Wait, you need more details? Okay, let’s
break it down...

Example explanation
The “design pattern” here is the use of wheelbarrows and carts. These are common, best
practice tools in gardening. Similarly, software design patterns form a set of best
practices in development. You could have chosen not to use wheelbarrows and carts, but
akin to avoiding software design patterns, you assume more risk by making the project
more time- and labor-intensive.

raywenderlich.com 22
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials Chapter 1: What are Design Patterns?

Back to the point of “asking other gardeners what they do.” Most design patterns have
been around for a long time — having started life in the 1970s and 1980s — and they
continue to work well to this day.

This longevity is partly due to the fact their use has been validated in many projects
over the decades, but it’s also because they aren’t concrete solutions.

In the gardening scenario, you decided that carts will be used to move flowers and
wheelbarrows will be used to move trees. These are implementation details: you could
have used carts to move both flowers and trees, only used wheelbarrows, or any other
combination that made the job easier.

Design patterns are generic, go-to solutions for solving common problems, like using
wheelbarrows and carts. They are starting points for concrete implementations, like
using carts for flowers and wheelbarrows for trees.

Make sense? Great! It's now time to leave the garden behind and head back to the world
of software design patterns.

Types of design patterns


There are three main types of design patterns:

1. Structural design pattern: Describes how objects are composed and combined to
form larger structures. Examples of structural design patterns include Model-View-
Controller (MVC), Model-View-ViewModel (MVVM) and Facade.

2. Behavioral design pattern: Describes how objects communicate with each other.
Examples of behavioral design patterns are Delegation, Strategy and Observer.

3. Creational design pattern: Describes how to create or instantiate objects.


Examples of creational patterns are Builder, Singleton and Prototype.

You may be wondering if knowing a design pattern’s type really matters. Well, yes...and
no.

It’s not useful to memorize all patterns by type. Most developers don’t do this. However,
if you’re not sure whether a particular pattern will work, it’s sometimes useful to
consider other patterns of the same type. You just might find one that works better for
your particular problem.

raywenderlich.com 23
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials Chapter 1: What are Design Patterns?

Note: There’s an ongoing debate on whether some patterns, including MVVM and
MVC, are actually architectural patterns, which span an entire app or subsystem
architecture. Hence, they are broader in scope than design patterns, which only
span components or pieces of an app. Architectural patterns can even use or
encompass several design patterns.
For the purposes of this book, a comprehensive discussion of architectural
patterns is out of scope. We’ve chosen to label MVVM and MVC as structural
design patterns because they can be used alongside other design patterns in a
component fashion. They are also very commonly used in iOS projects, and we
wanted to ensure we covered them.
If someone says these are actually architectural patterns, we don’t necessarily
disagree, as they can also be used that way.

Criticisms of design patterns


As indicated earlier, “there are no silver bullets in software development,” and design
patterns are no exception to this. This means that simply knowing and employing
design patterns will not guarantee you will create a well-architected piece of software.
There are dozens of design patterns, so knowing when and how to employ each one is
important.

Here are some common criticisms of design patterns:

If you overuse design patterns, your project can become overly


complex.
You need to be careful about overusing any tool, including design patterns. You can
minimize this issue by clearly and correctly defining the problem to be solved before
adding a design pattern to your project.

Many design patterns are made redundant by modern programming


languages.
It’s true that modern programming languages like Swift make some design patterns
irrelevant or trivial to implement. However, just because some patterns are provided via
a programming language doesn’t mean all patterns will be.

raywenderlich.com 24
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials Chapter 1: What are Design Patterns?

Design patterns are a lazy substitute for learning object-oriented


principles.
Why not learn both? A strong understanding of object-oriented principles will certainly
help you in your development.

However, if you already know a design pattern works well for a particular problem, why
should you reinvent the solution from scratch?

But, but...check out this thread on Twitter, which definitely shows that
design patterns are worthless!
Regardless of the particular criticism, design patterns have been around for a long time,
and they’ve been used in many apps. So at some point, you’re going to encounter them.

We think it’s best to have an understanding of what they are before you run into them,
instead of trying to wing it on the fly, which in our experience is usually late on a
Sunday night, the day before the release deadline, right after discovering a critical bug.

Benefits of design patterns


We’ve mentioned many benefits of design patterns already, but we wanted to point out
a few more:

Design patterns create a common language.


Instead of describing a particular solution in detail, you can simply state which design
pattern you think would work best. This streamlines communication between
developers.

Design patterns fast-track developer onboarding.


It’s much easier to onboard a new developer on a project that uses design patterns, than
on a project with completely custom logic.

Design patterns make you a better person.


Well, this one may still be up for debate. But some degree of self-improvement is never
wasted! However, there is a grain of truth to this, as the next developer to maintain your
project will certainly think you’re a better person for having left them a nice, design-
pattern-filled project instead of a spaghetti-coded mess!

raywenderlich.com 25
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials Chapter 1: What are Design Patterns?

Knowing design patterns allow you to spot similarities between code.


Once you know and understand different design patterns, you begin to notice their use
in code. This gives you a leg up as you are at least a little familiar with how to use that
code. For example, iOS and Mac programming makes heavy use of the Delegation
pattern. You would spot this pattern easily if you ever moved to another platform that
also uses Delegation and instantly be familiar with how the code is organized.

Key points
In this chapter, you learned what design patterns are and why you should care about
them. Here are the key points to remember:

• Design patterns aren't concrete implementations, but rather, they are a starting
point for writing code.

• Design patterns collectively form a set of best practices to help you write more
understandable and easier-to-maintain code.

• There are three main types of design patterns: structural, behavioral and creational.

• There are both criticisms and benefits of design patterns. Ultimately, they are
commonplace in software development, and you're likely to encounter them.
Therefore, having a good grasp of them is important.

raywenderlich.com 26
WOW! eBook
www.wowebook.org
2 Chapter 2: How to Read a
Class Diagram
By Joshua Greene

So now you know what design patterns are! In this chapter, you’re going to learn about
a fundamental concept to help you understand design patterns: the class diagram.

Class diagrams are like engineering blueprints; they provide information about a
system through the medium of pictures, symbols and annotations.

You may have heard of Unified Modeling Language (UML), which is a standard language
for creating class diagrams, architectural drawings and other system illustrations. A
complete discussion of UML is beyond the scope of this book, but you won’t need to
understand a lot of UML in your day-to-day iOS development. Instead, you’ll learn a
subset of UML in this chapter that’s useful for creating class diagrams and describing
design patterns.

What’s in a class diagram?


Class diagrams include classes, protocols, properties, methods and relationships.

A box denotes a class. Here’s a very simple class diagram for a Dog class:

raywenderlich.com 27
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials Chapter 2: How to Read a Class Diagram

To indicate that one class inherits from another, use an open arrowhead:

But instead of reading this as “inherits from,” read this as “is a”. For example, to show
that SheepDog inherits from Dog, you’d draw the following diagram:

You would read this, from bottom to top, as “SheepDog is a Dog.”

Use a plain arrowhead to indicate a property, which is known as an association in UML


terms:

Class diagrams can be written from bottom to top, from left to right, or in any other
orientation you’d like. Regardless of the orientation you choose, the direction of the
arrows define the meaning: Inheritance arrows always point at the superclass, and
property arrows always point at the property class.

raywenderlich.com 28
WOW! eBook
www.wowebook.org
Design Patterns by Tutorials Chapter 2: How to Read a Class Diagram

You should read a property arrow as “has a.” For example, if a Farmer has a Dog, you’d
draw this:

You can indicate one-to-many relationships by specifying a range next to the


arrowhead. For example, you can denote a Farmer has one or more Dogs like this:

You should always use the singular form of the class name in class diagrams, even if
you’re conveying a one-to-many relationship. In this case, you should write Dog, not
Dogs.

raywenderlich.com 29
WOW! eBook
www.wowebook.org
Exploring the Variety of Random
Documents with Different Content
For a moment there was a pause, and there was the madness of
suspense, and then she raised her head with her old dignity of mien
and looked at me with radiant eyes.
“From the first, I think, a little—monsieur,” she murmured, “but—had
I said so, they would have killed you!”
“A little!” I repeated passionately. “A little—after all—when I risked
my life for your love, and it is, after all—only a little!”
Then she smiled, and the first sunbeams made her face luminous as
the morning star.
“A little, I said, monsieur,” she whispered, “a little—at first!”
Then I drew her to me. “And now?” I cried; “and now, my princess?”
“Nay,” she said, “not the princess, but your wife, because”—she
raised her head a little again and met my eyes—“because I love you,
monsieur!” she faltered, blushing like a rose as I kissed her.
It was half an hour later; we had forgotten that the sun had risen,
and were walking hand in hand, under the fir-trees, when Vassalissa
came running toward us.
“You stay too long,” she cried; “too long! They will be calling for you,
Daria Kirilovna. You must either return with me or flee.”
“And if she stays with me, mademoiselle?” I said, amused at the
young girl’s eagerness; caring little for any risk that did not involve
the princess.
“Then fly—for your lives!” cried Lissa, and she pointed to the tall
figure of old Piotr, holding the horses, “there is not an hour to lose!”
“Ah, Lissa, Lissa!” cried my wife fondly; “how can I leave you here?”
The young girl mimicked her roguishly. “Will you stay with me, and
leave him?” she asked, and then, running to her cousin, she covered
her face and hands with caresses. “Go,” she cried, “go, my
sweetheart, to happiness—here they would not let you have it. I am
safe enough.”
But, while they clung to each other, with tears and kisses, I went
and spoke a few words to the old steward, the one man whom Daria
seemed to trust in that great retinue, and it was he who told me
what course to follow, and assured me that he could hold back
pursuit for twenty-four hours—just so long as the feigned illness that
the princess had announced to the household could be sustained,
just so long and no longer.
“After that, sir,” he said grimly, “if they take you, they will make short
work, but with twenty-four hours——”
“They will not take me,” I said quietly, and I looked to my horse,
hoof and girth and bridle, then I went back to where the two girls
wept in each other’s arms.
I would have waited, unwilling to tear them apart, but Lissa thrust
her cousin away.
“There!” she cried, between tears and laughter, “go and send me a
husband who will not beat me. As for me—I must go back to the
Princess Daria, who is ill,” and she held out her hand to me.
I kissed it, with sincere gratitude for her good offices, and I thanked
her, but she came closer to me and looked straight into my eyes with
her fearless blue ones.
“Be kind to her,” she said, very low, that Daria might not hear, “be
loving and be true—for she is a woman as well as a princess, and
she loves you!”
With that, the charming creature fled into the shadow of the firs,
followed by old Piotr, who had parted from his mistress solemnly,
and with tears. And the dwarf, mounting first, rode on, and the
Princess Daria and I followed slowly—riding side by side—out into
the sunrise of the world and of our lives.
THE END.
FOOTNOTES:
[A] A Russian proverb.
[B] The black lands.
TRANSCRIBER’S NOTES:
Obvious typographical errors have been corrected.
Inconsistencies in hyphenation have been
standardized.
Archaic or variant spelling has been retained.
*** END OF THE PROJECT GUTENBERG EBOOK THE REBELLION OF
THE PRINCESS ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

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. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

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.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• 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 provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like