Asynchronous PHP Bundle
Asynchronous PHP Bundle
About the Bundle
Learning Event-Driven PHP With ReactPHP
A lot has changed since PHP was used only for rendering web-pages. Now PHP is something more than a simple script, which is used to render a web page in a request-response cycle. The event-driven architecture and asynchronous I/O processing of any number of streams in real time allow you to build a whole new category of applications. This book covers everything you should know about creating asynchronous applications in ReactPHP. We start with the basics, such as an event loop, timers, and streams. And then gradually we will move to more advanced topics and real applications examples. ReactPHP has a great set of components and a real ecosystem of third-party libraries.
The book covers all ReactPHP core components with theory and code examples to give you a solid basis to build your own asynchronous application for your own use-case. If you have always written PHP applications in a traditional synchronous way, it will be an eye-opening book for you.
Also, I'm going to keep this book up-to-date with ReactPHP releases. That means that when a new feature comes out or something becomes deprecated or even removed, the book will also reflect these changes and will be republished and you will receive these updates for free!
ReactPHP for Beginners
The main purpose of this book is to get you started with developing asynchronous applications in PHP. I will show you that PHP is much more than run the script, execute some code and die. You will be amazed by the way your familiar PHP language can be used! The asynchronous model will definitely expand the way you think about PHP.
In fact, there is no need to learn a new language when you need to write some asynchronous stuff just because someone blames PHP that it is not a right tool. You can create asynchronous applications in PHP and this book will show you how.
It will be a step by step guide to building an asynchronous PHP application.
PHP OOP Way
What Is This Book About
Chapter 1 covers the fundamentals of the object-oriented programming: encapsulation, inheritance, and polymorphism. We will discuss the purpose of abstraction and inheritance, and why you should avoid using inheritance for code reuse. This chapter also covers such language specific features as traits and closures and their role in the object-oriented code. And at the end of the chapter, I will introduce such a powerful tool as Dependency Injection, different types of it and some code smells of its wrong usage.
Chapter 2 is fully devoted to SOLID principles. We will discuss each of them: the main idea behind the principle, how to apply it to your code and some problems that you can face following these principles blindly.
Chapter 3 is an introduction to an object-oriented design. It covers the well knows design principles such as:
- Tell, don't ask
- The Law of Demeter
This chapter also covers some basic anti-patterns that you can meet in the code with poor design.
Chapter 4 opens the topic of the design patterns and composition. We will discuss the difference between inheritance and composition and when each of them is more appropriate to use. This chapter covers such design patterns as State, Strategy, Adapter and their comparison with the inheritance approach.
Chapter 5 describes the problem "I don't have the interface that I want." . We will cover situations when we need to make two incompatible interfaces work together and how to reduce the complexity of the subsystem and hide it behind the friendly interface.
Chapter 6 is about GRASP principles and Responsibility Driven Design. It is often a challenge to choose the right object for a particular job and to decide how the objects should interact with each other. Correct responsibility assignments are the key to a good object oriented design.
Who Is This Book For
This is not a beginner's guide to OOP PHP. We are not going to cover the syntax of classes or the difference between public, protected and private keywords. I assume that you are already familiar with these things.
I assume that you are familiar with the language itself and have been using it in an object-oriented way for several years. The number of years does not matter. You can have a year of personal study and mastered the art of programming or ten years of maintaining the same application. Anyway, you know the basic concepts of the object-oriented programming, such as encapsulation, inheritance and polymorphism. Likely you have used a few of the modern MVC frameworks and even have studied their source code to go deeper.
The book is for you if you have left the basics behind some years ago and now feel free in writing complex OOP code. But you always feel that you don't fully understand why things should be in this way, and not differently. Maybe you know what every letter means in the SOLID acronym but have been always curious why strictly following these principles sometimes makes your application even worse than it was before.
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...