Mastering PHP design patterns develop robust and reusable code using a multitude of design patterns for PHP 7 Ali - Quickly download the ebook to never miss any content
Mastering PHP design patterns develop robust and reusable code using a multitude of design patterns for PHP 7 Ali - Quickly download the ebook to never miss any content
com
https://textbookfull.com/product/mastering-php-design-
patterns-develop-robust-and-reusable-code-using-a-multitude-
of-design-patterns-for-php-7-ali/
OR CLICK HERE
DOWLOAD EBOOK
https://textbookfull.com/product/design-patterns-in-php-and-
laravel-1st-edition-kelt-dockins/
textbookfull.com
https://textbookfull.com/product/puppet-best-practices-design-
patterns-for-maintainable-code-1st-edition-chris-barbour/
textbookfull.com
https://textbookfull.com/product/java-design-patterns-a-tour-
of-23-gang-of-four-design-patterns-in-java-1st-edition-vaskaran-
sarcar/
textbookfull.com
https://textbookfull.com/product/java-design-patterns-a-tour-
of-23-gang-of-four-design-patterns-in-java-1st-edition-vaskaran-
sarcar-2/
textbookfull.com
https://textbookfull.com/product/design-patterns-by-tutorials-
learning-design-patterns-in-swift-4-2-joshua-greene/
textbookfull.com
Mastering PHP Design Patterns
Junade Ali
BIRMINGHAM - MUMBAI
Mastering PHP Design Patterns
Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its
dealers and distributors will be held liable for any damages caused or alleged to be caused
directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
Livery Place
35 Livery Street
ISBN 978-1-78588-713-0
www.packtpub.com
Credits
Junade, an avid contributor to the PHP community, has also spoken at PHPTek and the
Lead Developer Conference. In addition to this, Junade was interviewed by Cal Evans for
Voices of the ElePHPant, and he has appeared on the PHP Roundtable. In this spirit, Junade
is proud of his local PHP user group: PHPWarks. Currently, Junade works at CloudFlare as
a polymath, and helps make the Internet more secure and faster.
Outside of development, Junade has an interest in law and political campaigns and is a
published author on constitutional law.
About the Reviewer
Sworup Shakya has worked as a web developer for more than ten years. He started his
career as a Flash ActionScript developer, before moving on to ASP.NET MVC, and finally to
PHP. During his time as a developer, Sworup worked extensively with frameworks, be it
ASP.NET MVC or AngularJS or Laravel. However, while he was working as an
ActionScript developer, he had to create one, which gave him knowledge of design patterns
and OOP concepts that has helped him improve in order to be able to work on the
frameworks he had to work on later.
Sworup likes to keep on top of the current technologies, keeping an eye on StackOverflow,
Laracasts forums, and occasional podcasts. He posts on these mediums whenever he can
and is looking to start a technical blog documenting his experiences at http://sworup.com.
np/. You can reach him at sworup.shakya@gmail.com.
I would like to thank Suzanne Coutinho, Francina Pinto and Chaitanya Nair of Packt Publishing for
giving me this opportunity and helping me through the review process. I would like to thank my
friends, family and colleagues for their unconditional support.
www.PacktPub.com
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a
print book customer, you are entitled to a discount on the eBook copy. Get in touch with us
at service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a
range of free newsletters and receive exclusive discounts and offers on Packt books and
eBooks.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt
books and video courses, as well as industry-leading tools to help you plan your personal
development and advance your career.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Table of Contents
Chapter 1: Why "Good PHP Developer" Isnt an Oxymoron 8
Coding style – the PSR standards 11
Revising object-oriented programming 11
Polymorphism 11
Traits (multiple inheritance) 16
Scalar type hints 19
Limiting debug access to private/protected properties 21
Setting up the environment with Composer 23
The Gang of Four (GoF) 26
Creational design patterns 27
Dependency injection 27
Structural design patterns 28
Behavioral design patterns 28
Architectural patterns 28
Summary 29
Chapter 2: Anti-Patterns 30
Why anti-patterns matter 31
Not invented here syndrome 34
Third-party dependencies with Composer 36
God objects 40
Environment variables in PHP source 43
Singletons (and why you should be using dependency injection) 44
Dependency injection 45
Database as IPC 45
Auto-increment database IDs 46
Cronjob imitating service 47
Software in place of architecture 47
Interface Bloat 49
Cart before the horse 51
Separation of development and operations 52
Excessive separation of development responsibilities 52
Error suppression operator 53
Blind faith 54
Sequential coupling 55
The big rewrite 58
Automated tests 59
Service splitting 60
Perfectly staged migrations 61
Tester-Driven Development 62
Bloated optimization 62
Analysis paralysis 63
Bikeshedding 63
Premature optimization 63
Uneducated manager syndrome 64
Wrong rocky foundations 64
Long methods 65
Magic numbers 70
Summary 70
Chapter 3: Creational Design Patterns 72
Software design process 72
Simple Factory 74
Factory Method 78
Abstract Factory pattern 82
Lazy initialization 90
Builder pattern 93
Prototype pattern 97
Summary 102
Chapter 4: Structural Design Patterns 103
Agile software architecture 104
Decorator 105
Adapter 108
Class Adapter 108
Object Adapter 110
FlyWeight 113
Composite 117
Bridge 120
Proxy pattern 123
Facade 127
Summary 130
Chapter 5: Behavioral Design Patterns 132
Personality traits for passionate programmers 133
Observer pattern (SplObserver/SplSubject) 135
[ ii ]
Iterators 139
IteratorAggregate 139
Iterator 141
The many iterators of PHP 142
Generators 143
Template Method design pattern 148
Chain of Responsibility 152
Strategy design pattern 159
Specification design pattern 163
Scheduled Task pattern 167
Summary 168
Chapter 6: Architectural Patterns 170
Model-View-Controller (MVC) 170
Service-oriented architecture 172
Microservices 173
Asynchronous queueing 177
Message Queue pattern (Getting started with RabbitMQ) 177
Publish-Subscriber pattern 187
Summary 191
Chapter 7: Refactoring 192
What is refactoring? 192
Test, test, and test again 193
Code smells 194
Long methods and duplicated code 195
Large class 197
Replacing complex logical statements and switch statements with
polymorphism or the Strategy Pattern 198
Duplicating code following a single control structure 200
Long Parameter List and primitive obsession 200
Indecent exposure 203
Feature envy 204
Inappropriate intimacy 206
Deeply nested statements 206
Remove assignments to parameters 207
Comments 208
Encapsulating Composite with Builder 208
Replacing hard-coded notifications with Observer 209
Replacing one/many distinctions with Composite 209
[ iii ]
Separate versions with Adapters 210
What do I tell my manager? 210
Summary 211
Chapter 8: How to Write Better Code 212
Nature of a HTTP request 212
RESTful API design 231
Stateless nature 231
Versioning 231
Filtering 232
Sorting 232
Searching 232
Limiting fields 233
Returning new fields 233
When in doubt – KISS 233
Software development life cycle 234
On Scrum, and real Agility 235
You need to sack people sometimes 237
Lean project management 239
YAGNI and defering decisions 239
Monitoring 240
Tests fight legacy 241
Behavior-Driven Development 243
Summary 250
Index 252
[ iv ]
Preface
Have you ever been to a PHP conference? If not, I’d highly recommend it, it is the closest
you can get to a living and breathing PHP community. A few weeks ago, I flew from
London to St. Louis, Misouri, to speak at php[tek] (the PHP conference run by
php[architect]). After the conference, there was a small tradition within the PHP community
known as WurstCon. Essentially, hundreds of PHP conference attendees cram themselves
into a small hot dog shop and host a hot dog convention, often to the complete surprise of
the staff there. Likewise, community nights at PHP events are the warmest and most
accepting community occasions you’ll ever run into; the PHP community is surely one that
other development language communities envy.
As of PHP 7, the PHP project has changed dramatically; but what I love, remains strong.
The warmth you will feel at any PHP conference, the openness in the documentation, and
adoption in the language. Yes, there are practices that are undoubtedly bad within PHP
itself; however, think of what the PHP community has recently achieved, ranging from
PHPUnit to Composer. Throughout this book, bear in mind the improvements in PHP 7, a
few of which I’ll share with you. The trajectory of the project is now certainly upwards, and
let’s not forget that this wasn’t always true. The PHP community has learned its lessons
from the past, whilst the language maintains the flexibility to write what is bad.
This book will seek to impart strong software engineering skills to you with the focus on
implementing them in PHP. At the time of publishing this book, there is a certain void and
a necessity for this kind of material. This book seeks to be the lighthouse that will not only
demonstrate software design theory, but also seek to impart practical information of real
value to improve the quality and maintainability of the code you write. This book leaves no
stone unturned throughout the software development cycle and will seek to confront the
reasons as to why the majority of software projects fail whilst also addressing design,
redesign, and safeguard effective code.
This book goes beyond traditional design patterns as envisaged by the Gang of Four and
details the practices that passionate PHP developers need to be successful as software
engineers or leads on detailed PHP projects. This book will introduce you to the core
knowledge required to understand project management techniques, why the majority
software development projects fail, and why you can make yours a success.
Preface
Originally, I gave thought to writing a book on PHP when Mandi Rose, who I worked with
previously, suggested I put together a book on the practices I’ve learned with PHP.
Needless to say, at the time that suggestion was made, the best of my career was
undoubtedly ahead of me; when the opportunity actually arose to write something like this,
I felt I had learned dramatically more as time progressed. By no means should you see this
book as the be-all and end-all of PHP practices; instead, you should use it to increase your
knowledge base on PHP, but by no means limit it to this. In this book, I aim to give
something, however small, back to the PHP community; after reading this book, I would
encourage you to get stuck in and share what you’ve learned with others.
Later in this book, I will advocate Extreme Programming as a methodology and courage as
a key value of this methodology. I will ask you to bear in mind the explanation of courage
in The Values of Extreme Programming: “We will tell the truth about progress and
estimates. We don't document excuses for failure because we plan to succeed. We don't fear
anything because no one ever works alone. We will adapt to changes whenever they
happen.” This is, of course, some key advice we should all follow and seek to genuinely
understand risks instead of cowering behind them. For many of us, the code we write
during parts of our career is the highest expression of our labor. Indeed, the late nights
turning into early mornings we spend debugging and developing are what ultimately allow
us to demonstrate the fruits of our labor. In essence, as software engineers, the code we
write defines who we are, as such we should be open to constantly refining and refactoring
our processes, which is what this book aims to support you in doing. I am incredibly
honored that you chose to allow me to help you to reach this end.
Chapter 3, Creational Design Patterns, discusses Gang of Four design patterns, namely those
surrounding object creation.
Chapter 4, Structural Design Patterns, covers how multiple classes and objects can be
combined to deliver a clearer interface.
[2]
Preface
Chapter 6, Architectural Patterns, revolves around resolving common issues related to the
architecture of a web application/system, potentially outside the code base itself.
Chapter 7, Refactoring, shows how to redesign code that has already been written to
improve maintainability.
Chapter 8, How to Write Better Code, covers a range of concepts that haven’t been discussed
elsewhere, and it also concludes with some advice for developers.
This book is not for the despairingly hostile or those who are passively antagonistic to
approaching new software engineering principles. It is not for those who seek to be lone
warriors, either. When altering a given code base, you must seek to improve the code of the
entire code base and everyone who works on it. You must be willing to take personal
responsibility of the code you write and not blame external factors. Code maintainability
cannot be improved unilaterally on shared code bases; you must write your code with the
intention of maintaining code quality for those who maintain it after you. Additionally, seek
to go into this book with the mindset of being able to share what you’ve learned, whether it
is with those in your teams, your user groups, or the larger PHP community. In other
words, approach this book with the end in mind; approach this book with the stated aim of
improving your code and those in the code base you maintain.
[3]
Preface
You will need a working knowledge of PHP and enough to build an application, but by no
means do you have to be a total expert at everything in PHP; a working knowledge of the
basics of software engineering will certainly give you a heads up.
You must encounter this book with an open mind and a willingness to have your
preconceptions about software development challenged. This book will confront some
truths about how you may be failing personally as a developer; it is vital that you approach
this book with a willingness to take these principles onboard.
This book presents a set of software development patterns and principles that you can
adopt. It is vital that you understand where these patterns should and shouldn’t be applied;
this will be explained throughout the book, especially in the last chapter.
A key tenet of reading this book is understanding what PHP is for and what it isn’t. I expect
you to enter this book understanding what problems you expect PHP to solve and what
you expect to use other software development languages to solve.
Conventions
In this book, you will find a number of text styles that distinguish between different kinds
of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The
index.php file now yields this result".
[4]
Preface
New terms and important words are shown in bold. Words that you see on the screen, for
example, in menus or dialog boxes, appear in the text like this: "direct your web browser to
your chosen web server and you should see Hello world! pop up on screen."
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this
book—what you liked or disliked. Reader feedback is important for us as it helps us
develop titles that you will really get the most out of.
If there is a topic that you have expertise in and you are interested in either writing or
contributing to a book, see our author guide at www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you
to get the most from your purchase.
[5]
Preface
1. Log in or register to our website using your e-mail address and password.
2. Hover the mouse pointer on the SUPPORT tab at the top.
3. Click on Code Downloads & Errata.
4. Enter the name of the book in the Search box.
5. Select the book for which you're looking to download the code files.
6. Choose from the drop-down menu where you purchased this book from.
7. Click on Code Download.
You can also download the code files by clicking on the Code Files button on the book's
webpage at the Packt Publishing website. This page can be accessed by entering the book's
name in the Search box. Please note that you need to be logged in to your Packt account.
Once the file is downloaded, please make sure that you unzip or extract the folder using the
latest version of:
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPubl
ishing/Mastering-PHP-Design-Patterns/. We also have other code bundles from our
rich catalog of books and videos available at https://github.com/PacktPublishing/.
Check them out!
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books—maybe a mistake in the text or the
code—we would be grateful if you could report this to us. By doing so, you can save other
readers from frustration and help us improve subsequent versions of this book. If you find
any errata, please report them by visiting http://www.packtpub.com/submit-errata,
selecting your book, clicking on the Errata Submission Form link, and entering the details
of your errata. Once your errata are verified, your submission will be accepted and the
errata will be uploaded to our website or added to any list of existing errata under the
Errata section of that title.
[6]
Preface
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At
Packt, we take the protection of our copyright and licenses very seriously. If you come
across any illegal copies of our works in any form on the Internet, please provide us with
the location address or website name immediately so that we can pursue a remedy.
We appreciate your help in protecting our authors and our ability to bring you valuable
content.
Questions
If you have a problem with any aspect of this book, you can contact us
at questions@packtpub.com, and we will do our best to address the problem.
[7]
Why "Good PHP Developer"
1
Isnt an Oxymoron
Back in 2010, MailChimp published a post on their blog, entitled Ewww, You Use PHP? In
this blog post, they described the horror when they explained their choice of PHP to
developers who consider the phrase good PHP programmer an oxymoron. In their rebuttal
they argued that their PHP wasn't your grandfathers PHP and that they use a sophisticated
framework. I tend to judge the quality of PHP on the basis of, not only how it functions, but
how secure it is and how it is architected. This book focuses on ideas of how you should
architect your code. The design of software allows for developers to ease the extension of
the code beyond its original purpose, in a bug-free and elegant fashion.
“Any fool can write code that a computer can understand. Good programmers write code
that humans can understand.”
This isn't just limited to code style, but how developers architect and structure their code.
I've encountered many developers with their noses constantly stuck in the documentation,
copying and pasting bits of code until it works; hacking snippets together until it works.
Moreover, I far too often see the software development process rapidly deteriorate as
developers ever more tightly couple their classes with functions of ever increasing length.
Software engineers mustn't just code software; they must know how to design it. Indeed
often a good software engineer, when interviewing other software engineers will ask
questions about the design of the code itself. It is trivial to get a piece of code that will
execute, and it is also benign to question a developer as to whether strtolower or
str2lower is the correct name of a function (for the record, it's strtolower). Knowing the
difference between a class and an object doesn't make you a competent developer; a better
interview question would, for example, be how one could apply subtype polymorphism to
Why "Good PHP Developer" Isnt an Oxymoron
a real software development challenge. Failure to assess software design skills dumbs down
an interview and results in there being no way to differentiate between those who are good
at it, and those who aren't. These advanced topics will be discussed throughout this book,
by learning these tactics, you will better understand what the right questions to ask are
when discussing software architecture.
“As a software developer, I envy writers, musicians, and filmmakers. Unlike software,
when they create something it is really done, forever”.
When developing software, we mustn't forget we are authors, not just of instructions for a
machine, but we are also authoring something that we later expect others to extend upon.
Therefore, our code mustn't just be targeted at machines, but humans also. Code isn't just
poetry for a machine, it should be poetry for humans also.
This is, of course, better said than done. In PHP, this may be found especially difficult given
the freedom PHP offers developers on how they may architect and structure their code. By
the very nature of freedom, it may be both used and abused, so it is true with the freedom
offered in PHP.
Technical debt, the eventual consequence of poor system design, is something that I've
found comes with the career of a PHP developer. This has been true for me whether it has
been dealing with systems that provide advanced functionality or simple websites. It
usually arises because a developer elects to implement a bad design for a variety of reasons;
this is when adding functionality to an existing codebase or taking poor design decisions
during the initial construction of software. Refactoring can help us address these issues.
SensioLabs (the creators of the Symfony framework) have a tool called Insight that allows
developers to calculate the technical debt in their own code. In 2011, they did an evaluation
of technical debt in various projects using this tool; rather unsurprisingly they found that
WordPress 4.1 topped the chart of all platforms they evaluated with them claiming it would
take 20.1 years to resolve the technical debt that the project contains.
[9]
Why "Good PHP Developer" Isnt an Oxymoron
Those familiar with the WordPress core may not be surprised by this, but this issue of
course is not only associated to WordPress. In my career of working with PHP, from
working with security critical cryptography systems to working with systems that work
with mission critical embedded systems, dealing with technical debt comes with the job.
Dealing with technical debt is not something to be ashamed of for a PHP developer, indeed
some may consider it courageous. Dealing with technical debt is no easy task, especially in
the face of an ever more demanding user base, client, or project manager; constantly
demanding more functionality without being familiar with the technical debt the project
has associated to it.
I recently e-mailed the PHP Internals group as to whether they should consider deprecating
the error suppression operator @. When any PHP function is prepended by an @ symbol, the
function will suppress an error returned by it. This can be brutal, especially where that
function renders a fatal error that stops the execution of the script, making debugging a
tough task. If the error is suppressed, the script may fail to execute without providing
developers a reason as to why this is. Usage of this operator may be described as an anti-
pattern in some situations, something we will cover in Chapter 4, Structural Design Patterns.
Despite the fact that no one objected to the fact that there were better ways of handling
errors (try/catch, proper validation) than abusing the error suppression operator and
that deprecation should be an eventual aim of PHP, it is the case that some functions return
needless warnings even though they already have a success/failure value. This means that
due to technical debt in the PHP core itself, this operator cannot be deprecated until a lot of
other prerequisite work is done. In the meantime, it is down to developers to decide the best
methodologies of handling errors. Until the inherent problem of unnecessary error
reporting is addressed, this operator cannot be deprecated. Therefore, it is down to
developers to be educated as to the proper methodologies that should be used to address
error handling and not to constantly resort to using an @ symbol.
Fundamentally, technical debt slows down development of a project and often leads to code
being deployed that is broken as developers try and work on a fragile project.
When starting a new project, never be afraid to discuss architecture as architecture meetings
are vital to developer collaboration; as one Scrum Master I've worked with said in the face
of criticism that “meetings are a great alternative to work”, he said “meetings are
work…how much work would you be doing without meetings?”.
[ 10 ]
Why "Good PHP Developer" Isnt an Oxymoron
Coding style being used to enforce consistency throughout a code base is something I
strongly believe in. It does make a difference to your code readability throughout a project.
It is especially important when you are starting a project (chances are you may be reading
this book to find out how to do that right) as your coding style determines the style the
developers following you in working on this project will adopt. Using a global standard
such as PSR-1 or PSR-2 means that developers can easily switch between projects without
having to reconfigure their code style in their IDE. Good code style can make formatting
errors easier to spot. Needless to say that coding styles will develop as time progresses, to
date I elect to work with the PSR standards.
I am a strong believer in the phrase: always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live. It isn't known who wrote this phrase
originally, but it's widely thought that it could have been John Woods or potentially Martin
Golding.
I would strongly recommend familiarizing yourself with these standards before proceeding
in this book.
Assuming you're aware of classes (and how to instantiate them), allow me to remind you of
a few different bits and pieces.
[ 11 ]
Why "Good PHP Developer" Isnt an Oxymoron
Polymorphism
Polymorphism is a fairly long word for a fairly simple concept. Essentially, polymorphism
means the same interface is used with a different underlying code. So multiple classes could
have a draw function, each accepting the same arguments, but at an underlying level, the
code is implemented differently.
In this section, I would like to talk about Subtype Polymorphism in particular (also known
as Subtyping or Inclusion Polymorphism).
Let's say we have animals as our supertype; our subtypes may well be cats, dogs, and
sheep.
In PHP, interfaces allow you to define a set of functionality that a class that implements it
must contain, as of PHP 7 you can also use scalar type hints to define the return types we
expect.
If we were to run this code without defining the classes we would get an error message as
follows:
Class Cat contains 2 abstract methods and must therefore be declared
abstract or implement the remaining methods (Animal::eat, Animal::talk)
Essentially, we are required to implement the methods we defined in our interface, so now
let's go ahead and create a class that implements these methods:
class Cat implements Animal
{
public function eat(string $food): bool
{
if ($food === "tuna") {
return true;
} else {
[ 12 ]
Why "Good PHP Developer" Isnt an Oxymoron
return false;
}
}
Now that we've implemented these methods, we can then just instantiate the class we are
after and use the functions contained in it:
$felix = new Cat();
echo $felix->talk(false);
So where does polymorphism come into this? Suppose we had another class for a dog:
class Dog implements Animal
{
public function eat(string $food): bool
{
if (($food === "dog food") || ($food === "meat")) {
return true;
} else {
return false;
}
}
Now let's suppose we have multiple different types of animals in a pets array:
$pets = array(
'felix' => new Cat(),
'oscar' => new Dog(),
[ 13 ]
Why "Good PHP Developer" Isnt an Oxymoron
We can now actually go ahead and loop through all these pets individually in order to run
the talk function. We don't care about the type of pet because the talk method that is
implemented in every class we get is by virtue of us having extended the Animals interface.
So let's suppose we wanted to have all our animals run the talk method. We could just use
the following code:
foreach ($pets as $pet) {
echo $pet->talk(false);
}
No need for unnecessary switch/case blocks in order to wrap around our classes, we just
use software design to make things easier for us in the long-term.
Abstract classes work in a similar way, except for the fact that abstract classes can contain
functionality where interfaces cannot.
It is important to note that any class that defines one or more abstract classes must also be
defined as abstract. You cannot have a normal class defining abstract methods, but you can
have normal methods in abstract classes. Let's start off by refactoring our interface to be an
abstract class:
abstract class Animal
{
abstract public function eat(string $food) : bool;
You might have noticed that I have also added a walk method as an ordinary, non-abstract
method; this is a standard method that can be used or extended by any classes that inherit
the parent abstract class. They already have their implementation.
Note that it is impossible to instantiate an abstract class (much like it's not possible to
instantiate an interface). Instead, we must extend it.
[ 14 ]
Why "Good PHP Developer" Isnt an Oxymoron
That's all we need to refactor in order to get classes to extend the Animal abstract class. We
must implement the abstract functions in the classes as we outlined for the interfaces, plus
we can use the ordinary functions without needing to implement them:
$whiskers = new Cat();
$whiskers->walk(1);
As of PHP 5.4 it has also become possible to instantiate a class and access a property of it in
one system. PHP.net advertised it as: Class member access on instantiation has been added, e.g.
(new Foo)->bar(). You can also do it with individual properties, for example, (new
Cat)->legs. In our example, we can use it as follows:
(new \IcyApril\ChapterOne\Cat())->walk(1);
Just to recap a few other points about how PHP implemented OOP, the final keyword
before a class declaration or indeed a function declaration means that you cannot override
such classes or functions after they've been defined.
[ 15 ]
Why "Good PHP Developer" Isnt an Oxymoron
Traditional multiple inheritance is a controversial process that is often looked down upon
by software engineers.
Let me give you an example of using Traits first hand; let's define an abstract Animal class
that we want to extend into another class:
class Animal
{
public function walk()
{
return "walking...";
}
}
[ 16 ]
Why "Good PHP Developer" Isnt an Oxymoron
So now let's suppose we have a function to name our class, but we don't want it to apply to
all our classes that extend the Animal class, we want it to apply to certain classes
irrespective of whether they inherit the properties of the abstract Animal class or not.
The problem now is that there is no place we can put them without using Horizontal Reuse,
apart from copying and pasting different bits of code or resorting to using conditional
inheritance. This is where Traits come to the rescue; let's start off by wrapping these
methods in a Trait called Name:
trait Name
{
function setFirstName(string $name): bool
{
$this->firstName = $name;
return true;
}
So now that we've defined our Trait, we can just tell PHP to use it in our Cat class:
class Cat extends Animal
{
use Name;
[ 17 ]
Why "Good PHP Developer" Isnt an Oxymoron
}
}
Notice the use of the Name statement? That's where the magic happens. Now you can call
the functions in that Trait without any problems:
$whiskers = new Cat();
$whiskers->setFirstName('Paul');
echo $whiskers->firstName;
class Animal
{
public function walk()
{
return "walking...";
}
}
[ 18 ]
Another Random Document on
Scribd Without Any Related Topics
The news told, Nicolas looks stem and we begin to talk business.
If an outsider were then to hear how freely Nicolas uses the jargon,
he would be inclined to think that he was a scholar, posing as a
soldier. By the way, the rumours of the university-porter's erudition
are very exaggerated. It is true that Nicolas knows more than a
hundred Latin tags, can put a skeleton together and on occasion
make a preparation, can make the students laugh with a long
learned quotation, but the simple theory of the circulation of the
blood is as dark to him now as it was twenty years ago.
At the table in my room, bent low over a book or a preparation,
sits my dissector, Peter Ignatievich. He is a hardworking, modest
man of thirty-five without any gifts, already bald and with a big belly.
He works from morning to night, reads tremendously and
remembers everything he has read. In this respect he is not merely
an excellent man, but a man of gold; but in all others he is a cart-
horse, or if you like a learned blockhead. The characteristic traits of
a cart-horse which distinguish him from a creature of talent are
these. His outlook is narrow, absolutely bounded by his specialism.
Apart from his own subject he is as naive as a child. I remember
once entering the room and saying:
"Think what bad luck! They say, Skobielev is dead."
Nicolas crossed himself; but Peter Ignatievich turned to me:
"Which Skobielev do you mean?"
Another time,—some time earlier—I announced that Professor
Pierov was dead. That darling Peter Ignatievich asked:
"What was his subject?"
I imagine that if Patti sang into his ear, or Russia were attacked by
hordes of Chinamen, or there was an earthquake, he would not lift a
finger, but would go on in the quietest way with his eye screwed
over his microscope. In a word: "What's Hecuba to him?" I would
give anything to see how this dry old stick goes to bed with his wife.
Another trait: a fanatical belief in the infallibility of science, above
all in everything that the Germans write. He is sure of himself and
his preparations, knows the purpose of life, is absolutely ignorant of
the doubts and disillusionments that turn talents grey,—a slavish
worship of the authorities, and not a shadow of need to think for
himself. It is hard to persuade him and quite impossible to discuss
with him. Just try a discussion with a man who is profoundly
convinced that the best science is medicine, the best men doctors,
the best traditions—the medical! From the ugly past of medicine only
one tradition has survived,—the white necktie that doctors wear still.
For a learned, and more generally for an educated person there can
exist only a general university tradition, without any division into
traditions of medicine, of law, and so on. But it's quite impossible for
Peter Ignatievich to agree with that; and he is ready to argue it with
you till doomsday.
His future is quite plain to me. During the whole of his life he will
make several hundred preparations of extraordinary purity, will write
any number of dry, quite competent, essays, will make about ten
scrupulously accurate translations; but he won't invent gunpowder.
For gunpowder, imagination is wanted, inventiveness, and a gift for
divination, and Peter Ignatievich has nothing of the kind. In short,
he is not a master of science but a labourer.
Peter Ignatievich, Nicolas, and I whisper together. We are rather
strange to ourselves. One feels something quite particular, when the
audience booms like the sea behind the door. In thirty years I have
not grown used to this feeling, and I have it every morning. I button
up my frock-coat nervously, ask Nicolas unnecessary questions, get
angry.... It is as though I were afraid; but it is not fear, but
something else which I cannot name nor describe.
Unnecessarily, I look at my watch and say:
"Well, it's time to go."
And we march in, in this order: Nicolas with the preparations or
the atlases in front, myself next, and after me, the cart-horse,
modestly hanging his head; or, if necessary, a corpse on a stretcher
in front and behind the corpse Nicolas and so on. The students rise
when I appear, then sit down and the noise of the sea is suddenly
still. Calm begins.
I know what I will lecture about, but I know nothing of how I will
lecture, where I will begin and where I will end. There is not a single
sentence ready in my brain. But as soon as I glance at the audience,
sitting around me in an amphitheatre, and utter the stereotyped "In
our last lecture we ended with...." and the sentences fly out of my
soul in a long line—then it is full steam ahead. I speak with
irresistible speed, and with passion, and it seems as though no
earthly power could check the current of my speech. In order to
lecture well, that is without being wearisome and to the listener's
profit, besides talent you must have the knack of it and experience;
you must have a clear idea both of your own powers, of the people
to whom you are lecturing, and of the subject of your remarks.
Moreover, you must be quick in the uptake, keep a sharp eye open,
and never for a moment lose your field of vision.
When he presents the composer's thought, a good conductor does
twenty things at once. He reads the score, waves his baton, watches
the singer makes a gesture now towards the drum, now to the
double-bass, and so on. It is the same with me when lecturing. I
have some hundred and fifty faces before me, quite unlike each
other, and three hundred eyes staring me straight in the face. My
purpose is to conquer this many-headed hydra. If I have a clear idea
how far they are attending and how much they are comprehending
every minute while I am lecturing, then the hydra is in my power. My
other opponent is within me. This is the endless variety of forms,
phenomena and laws, and the vast number of ideas, whether my
own or others', which depend upon them. Every moment I must be
skilful enough to choose what is most important and necessary from
this enormous material, and just as swiftly as my speech flows to
clothe my thought in a form which will penetrate the hydra's
understanding and excite its attention. Besides I must watch
carefully to see that my thoughts shall not be presented as they
have been accumulated, but in a certain order, necessary for the
correct composition of the picture which I wish to paint. Further, I
endeavour to make my speech literary, my definitions brief and
exact, my sentences as simple and elegant as possible. Every
moment I must hold myself in and remember that I have only an
hour and forty minutes to spend. In other words, it is a heavy
labour. At one and the same time you have to be a savant, a
schoolmaster, and an orator, and it is a failure if the orator triumphs
over the schoolmaster in you or the schoolmaster over the orator.
After lecturing for a quarter, for half an hour, I notice suddenly
that the students have begun to stare at the ceiling or Peter
Ignatievich. One will feel for his handkerchief, another settle himself
comfortably, another smile at his own thoughts. This means their
attention is tried. I must take steps. I seize the first opening and
make a pun. All the hundred and fifty faces have a broad smile, their
eyes flash merrily, and for a while you can hear the boom of the sea.
I laugh too. Their attention is refreshed and I can go on.
No sport, no recreation, no game ever gave me such delight as
reading a lecture. Only in a lecture could I surrender myself wholly
to passion and understand that inspiration is not a poet's fiction, but
exists indeed. And I do not believe that Hercules, even after the
most delightful of his exploits, felt such a pleasant weariness as I
experienced every time after a lecture.
This was in the past. Now at lectures I experience only torture.
Not half an hour passes before I begin to feel an invincible weakness
in my legs and shoulders. I sit down in my chair, but I am not used
to lecture sitting. In a moment I am up again, and lecture standing.
Then I sit down again. Inside my mouth is dry, my voice is hoarse,
my head feels dizzy. To hide my state from my audience I drink
some water now and then, cough, wipe my nose continually, as
though I was troubled by a cold, make inopportune puns, and finally
announce the interval earlier than I should. But chiefly I feel
ashamed.
Conscience and reason tell me that the best thing I could do now
is to read my farewell lecture to the boys, give them my last word,
bless them and give up my place to someone younger and stronger
than I. But, heaven be my judge, I have not the courage to act up to
my conscience.
Unfortunately, I am neither philosopher nor theologian. I know
quite well I have no more than six months to live; and it would seem
that now I ought to be mainly occupied with questions of the
darkness beyond the grave, and the visions which will visit my sleep
in the earth. But somehow my soul is not curious of these questions,
though my mind grants every atom of their importance. Now before
my death it is just as it was twenty or thirty years ago. Only science
interests me.—When I take my last breath I shall still believe that
Science is the most important, the most beautiful, the most
necessary thing in the life of man; that she has always been and
always will be the highest manifestation of love, and that by her
alone will man triumph over nature and himself. This faith is,
perhaps, at bottom naive and unfair, but I am not to blame if this
and not another is my faith. To conquer this faith within me is for me
impossible.
But this is beside the point. I only ask that you should incline to
my weakness and understand that to tear a man who is more deeply
concerned with the destiny of a brain tissue than the final goal of
creation away from his rostrum and his students is like taking him
and nailing him up in a coffin without waiting until he is dead.
Because of my insomnia and the intense struggle with my
increasing weakness a strange thing happens inside me. In the
middle of my lecture tears rise to my throat, my eyes begin to ache,
and I have a passionate and hysterical desire to stretch out my
hands and moan aloud. I want to cry out that fate has doomed me,
a famous man, to death; that in some six months here in the
auditorium another will be master. I want to cry out that I am
poisoned; that new ideas that I did not know before have poisoned
the last days of my life, and sting my brain incessantly like
mosquitoes. At that moment my position seems so terrible to me
that I want all my students to be terrified, to jump from their seats
and rush panic-stricken to the door, shrieking in despair.
It is not easy to live through such moments.
II
III
As usual she is lying on the Turkish divan or the couch and reading
something. Seeing me she lifts her head languidly, sits down, and
gives me her hand.
"You are always lying down like that," I say after a reposeful
silence. "It's unhealthy. You'd far better be doing something."
"Ah?"
"You'd far better be doing something, I say."
"What?... A woman can be either a simple worker or an actress."
"Well, then—if you can't become a worker, be an actress."
She is silent.
"You had better marry," I say, half-joking.
"There's no one to marry: and no use if I did."
"You can't go on living like this."
"Without a husband? As if that mattered. There are as many men
as you like, if you only had the will."
"This isn't right, Katy."
"What isn't right?"
"What you said just now."
Katy sees that I am chagrined, and desires to soften the bad
impression.
"Come. Let's come here. Here."
She leads me into a small room, very cosy, and points to the
writing table.
"There. I made it for you. You'll work here. Come every day and
bring your work with you. They only disturb you there at home....
Will you work here? Would you like to?"
In order not to hurt her by refusing, I answer that I shall work
with her and that I like the room immensely. Then we both sit down
in the cosy room and begin to talk.
The warmth, the cosy surroundings, the presence of a
sympathetic being, rouses in me now not a feeling of pleasure as it
used but a strong desire to complain and grumble. Anyhow it seems
to me that if I moan and complain I shall feel better.
"It's a bad business, my dear," I begin with a sigh. "Very bad."
"What is the matter?"
"I'll tell you what is the matter. The best and most sacred right of
kings is the right to pardon. And I have always felt myself a king so
long as I used this right prodigally. I never judged, I was
compassionate, I pardoned everyone right and left. Where others
protested and revolted I only advised and persuaded. All my life I've
tried to make my society tolerable to the family of students, friends
and servants. And this attitude of mine towards people, I know,
educated every one who came into contact with me. But now I am
king no more. There's something going on in me which belongs only
to slaves. Day and night evil thoughts roam about in my head, and
feelings which I never knew before have made their home in my
soul. I hate and despise; I'm exasperated, disturbed, and afraid. I've
become strict beyond measure, exacting, unkind, and suspicious.
Even the things which in the past gave me the chance of making an
extra pun, now bring me a feeling of oppression. My logic has
changed too. I used to despise money alone; now I cherish evil
feelings, not to money, but to the rich, as if they were guilty. I used
to hate violence and arbitrariness; now I hate the people who
employ violence, as if they alone are to blame and not all of us, who
cannot educate one another. What does it all mean? If my new
thoughts and feelings come from a change of my convictions, where
could the change have come from? Has the world grown worse and
I better, or was I blind and indifferent before? But if the change is
due to the general decline of my physical and mental powers—I am
sick and losing weight every day—then I'm in a pitiable position. It
means that my new thoughts are abnormal and unhealthy, that I
must be ashamed of them and consider them valueless...."
"Sickness hasn't anything to do with it," Katy interrupts. "Your
eyes are opened—that's all. You've begun to notice things you didn't
want to notice before for some reason. My opinion is that you must
break with your family finally first of all and then go away."
"You're talking nonsense."
"You don't love them any more. Then, why do you behave
unfairly? And is it a family! Mere nobodies. If they died to-day, no
one would notice their absence to-morrow."
Katy despises my wife and daughter as much as they hate her. It's
scarcely possible nowadays to speak of the right of people to despise
one another. But if you accept Katy's point of view and own that
such a right exists, you will notice that she has the same right to
despise my wife and Liza as they have to hate her.
"Mere nobodies!" she repeats. "Did you have any dinner to-day?
It's a wonder they didn't forget to tell you dinner was ready. I don't
know how they still remember that you exist."
"Katy!" I say sternly. "Please be quiet."
"You don't think it's fun for me to talk about them, do you? I wish
I didn't know them at all. You listen to me, dear. Leave everything
and go away: go abroad—the quicker, the better."
"What nonsense! What about the University?"
"And the University, too. What is it to you? There's no sense in it
all. You've been lecturing for thirty years, and where are your pupils?
Have you many famous scholars? Count them up. But to increase
the number of doctors who exploit the general ignorance and make
hundreds of thousands,—there's no need to be a good and gifted
man. You aren't wanted."
"My God, how bitter you are!" I get terrified. "How bitter you are.
Be quiet, or I'll go away. I can't reply to the bitter things you say."
The maid enters and calls us to tea. Thank God, our conversation
changes round the samovar. I have made my moan, and now I want
to indulge another senile weakness—reminiscences. I tell Katy about
my past, to my great surprise with details that I never suspected I
had kept safe in my memory. And she listens to me with emotion,
with pride, holding her breath. I like particularly to tell how I once
was a student at a seminary and how I dreamed of entering the
University.
"I used to walk in the seminary garden," I tell her, "and the wind
would bring the sound of a song and the thrumming of an accordion
from a distant tavern, or a troika with bells would pass quickly by
the seminary fence. That would be quite enough to fill not only my
breast with a sense of happiness, but my stomach, legs, and hands.
As I heard the sound of the accordion or the bells fading away, I
would see myself a doctor and paint pictures, one more glorious
than another. And, you see, my dreams came true. There were more
things I dared to dream of. I have been a favourite professor thirty
years, I have had excellent friends and an honourable reputation. I
loved and married when I was passionately in love. I had children.
Altogether, when I look back the whole of my life seems like a nice,
clever composition. The only thing I have to do now is not to spoil
the finale. For this, I must die like a man. If death is really a danger
then I must meet it as becomes a teacher, a scholar, and a citizen of
a Christian State. But I am spoiling the finale. I am drowning, and I
run to you and beg for help, and you say: 'Drown. It's your duty.'"
At this point a ring at the bell sounds in the hall. Katy and I both
recognise it and say:
"That must be Mikhail Fiodorovich."
And indeed in a minute Mikhail Fiodorovich, my colleague, the
philologist, enters. He is a tall, well-built man about fifty years old,
clean shaven, with thick grey hair and black eyebrows. He is a good
man and an admirable friend. He belongs to an old aristocratic
family, a prosperous and gifted house which has played a notable
rôle in the history of our literature and education. He himself is
clever, gifted, and highly educated, but not without his eccentricities.
To a certain extent we are all eccentric, queer fellows, but his
eccentricities have an element of the exceptional, not quite safe for
his friends. Among the latter I know not a few who cannot see his
many merits clearly because of his eccentricities.
As he walks in he slowly removes his gloves and says in his
velvety bass:
"How do you do? Drinking tea. Just in time. It's hellishly cold."
Then he sits down at the table, takes a glass of tea and
immediately begins to talk. What chiefly marks his way of talking is
his invariably ironical tone, a mixture of philosophy and jest, like
Shakespeare's grave-diggers. He always talks of serious matters; but
never seriously. His opinions are always acid and provocative, but
thanks to his tender, easy, jesting tone, it somehow happens that his
acidity and provocativeness don't tire one's ears, and one very soon
gets used to it. Every evening he brings along some half-dozen
stories of the university life and generally begins with them when he
sits down at the table.
"O Lord," he sighs with an amusing movement of his black
eyebrows, "there are some funny people in the world."
"Who?" asks Katy.
"I was coming down after my lecture to-day and I met that old
idiot N—— on the stairs. He walks along, as usual pushing out that
horse jowl of his, looking for some one to bewail his headaches, his
wife, and his students, who won't come to his lectures. 'Well,' I think
to myself, 'he's seen me. It's all up—no hope for And so on in the
same strain. Or he begins like this,
"Yesterday I was at Z's public lecture. Tell it not in Gath, but I do
wonder how our alma mater dares to show the public such an ass,
such a double-dyed blockhead as Z. Why he's a European fool. Good
Lord, you won't find one like him in all Europe—not even if you
looked in daytime, and with a lantern. Imagine it: he lectures as
though he were sucking a stick of barley-sugar—su—su—su. He gets
a fright because he can't make out his manuscript. His little thoughts
will only just keep moving, hardly moving, like a bishop riding a
bicycle. Above all you can't make out a word he says. The flies die of
boredom, it's so terrific. It can only be compared with the boredom
in the great Hall at the Commemoration, when the traditional speech
is made. To hell with it!"
Immediately an abrupt change of subject.
"I had to make the speech; three years ago. Nicolai Stiepanovich
will remember. It was hot, close. My full uniform was tight under my
arms, tight as death. I read for half an hour, an hour, an hour and a
half, two hours. 'Well,' I thought, 'thank God I've only ten pages left.'
And I had four pages of peroration that I needn't read at all. 'Only
six pages then,' I thought. Imagine it. I just gave a glance in front of
me and saw sitting next to each other in the front row a general
with a broad ribbon and a bishop. The poor devils were bored stiff.
They were staring about madly to stop themselves from going to
sleep. For all that they are still trying to look attentive, to make
some appearance of understanding what I'm reading, and look as
though they like it. 'Well,' I thought, 'if you like it, then you shall
have it. I'll spite you.' So I set to and read the four pages, every
word."
When he speaks only his eyes and eyebrows smile as it is
generally with the ironical. At such moments there is no hatred or
malice in his eyes but a great deal of acuteness and that peculiar
fox-cunning which you can catch only in very observant people.
Further, about his eyes I have noticed one more peculiarity. When he
takes his glass from Katy, or listens to her remarks, or follows her
with a glance as she goes out of the room for a little while, then I
catch in his look something humble, prayerful, pure....
The maid takes the samovar away and puts on the table a big
piece of cheese, some fruit, and a bottle of Crimean champagne, a
thoroughly bad wine which Katy got to like when she lived in the
Crimea. Mikhail Fiodorovich takes two packs of cards from the
shelves and sets them out for patience. If one may believe his
assurances, some games of patience demand a great power of
combination and concentration. Nevertheless while he sets out the
cards he amuses himself by talking continually. Katy follows his cards
carefully, helping him more by mimicry than words. In the whole
evening she drinks no more than two small glasses of wine, I drink
only a quarter of a glass, the remainder of the bottle falls to Mikhail
Fiodorovich, who can drink any amount without ever getting drunk.
During patience we solve all kinds of questions, mostly of the lofty
order, and our dearest love, science, comes off second best.
"Science, thank God, has had her day," says Mikhail Fiodorovich
very slowly. "She has had her swan-song. Ye-es. Mankind has begun
to feel the desire to replace her by something else. She was grown
from the soil of prejudice, fed by prejudices, and is now the same
quintessence of prejudices as were her bygone grandmothers:
alchemy, metaphysics and philosophy. As between European
scholars and the Chinese who have no sciences at all the difference
is merely trifling, a matter only of externals. The Chinese had no
scientific knowledge, but what have they lost by that?"
"Flies haven't any scientific knowledge either," I say; "but what
does that prove?"
"It's no use getting angry, Nicolai Stiepanich. I say this only
between ourselves. I'm more cautious than you think. I shan't
proclaim it from the housetops, God forbid! The masses still keep
alive a prejudice that science and art are superior to agriculture and
commerce, superior to crafts. Our persuasion makes a living from
this prejudice. It's not for you and me to destroy it. God forbid!"
During patience the younger generation also comes in for it.
"Our public is degenerate nowadays," Mikhail Fiodorovich sighs. "I
don't speak of ideals and such things, I only ask that they should be
able to work and think decently. 'Sadly I look at the men of our
time'—it's quite true in this connection."
"Yes, they're frightfully degenerate," Katy agrees. "Tell me, had
you one single eminent person under you during the last five or ten
years?"
"I don't know how it is with the other professors,—but somehow I
don't recollect that it ever happened to me."
"In my lifetime I've seen a great many of your students and young
scholars, a great many actors.... What happened? I never once had
the luck to meet, not a hero or a man of talent, but an ordinarily
interesting person. Everything's dull and incapable, swollen and
pretentious...."
All these conversations about degeneracy give me always the
impression that I have unwittingly overheard an unpleasant
conversation about my daughter. I feel offended because the
indictments are made wholesale and are based upon such ancient
hackneyed commonplaces and such penny-dreadful notions as
degeneracy, lack of ideals, or comparisons with the glorious past.
Any indictment, even if it's made in a company of ladies, should be
formulated with all possible precision; otherwise it isn't an
indictment, but an empty calumny, unworthy of decent people.
I am an old man, and have served for the last thirty years; but I
don't see any sign either of degeneracy or the lack of ideals. I don't
find it any worse now than before. My porter, Nicolas, whose
experience in this case has its value, says that students nowadays
are neither better nor worse than their predecessors.
If I were asked what was the thing I did not like about my present
pupils, I wouldn't say offhand or answer at length, but with a certain
precision. I know their defects and there's no need for me to take
refuge in a mist of commonplaces. I don't like the way they smoke,
and drink spirits, and marry late; or the way they are careless and
indifferent to the point of allowing students to go hungry in their
midst, and not paying their debts into "The Students' Aid Society."
They are ignorant of modern languages and express themselves
incorrectly in Russian. Only yesterday my colleague, the hygienist,
complained to me that he had to lecture twice as often because of
their incompetent knowledge of physics and their complete
ignorance of meteorology. They are readily influenced by the most
modern writers, and some of those not the best, but they are
absolutely indifferent to classics like Shakespeare, Marcus Aurelius,
Epictetus and Pascal; and their worldly unpracticality shows itself
mostly in their inability to distinguish between great and small. They
solve all difficult questions which have a more or less social
character (emigration, for instance) by getting up subscriptions, but
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.
textbookfull.com