Zum Hauptinhalt springen
Nicht aus der Schweiz? Besuchen Sie lehmanns.de
Design Patterns in PHP and Laravel - Kelt Dockins

Design Patterns in PHP and Laravel (eBook)

(Autor)

eBook Download: PDF
2016 | 1st ed.
XXIII, 238 Seiten
Apress (Verlag)
978-1-4842-2451-9 (ISBN)
Systemvoraussetzungen
62,99 inkl. MwSt
(CHF 61,50)
Der eBook-Verkauf erfolgt durch die Lehmanns Media GmbH (Berlin) zum Preis in Euro inkl. MwSt.
  • Download sofort lieferbar
  • Zahlungsarten anzeigen
This book teaches you design patterns in PHP and Laravel using real-world examples and plenty of humor. Too often design patterns are explained using tricky concepts, when in fact they are easy to use and can enrich your everyday development. Design Patterns in PHP and Laravel aims to break down tricky concepts into humorous and easy-to-recall details, so that you can begin using design patterns easily in your everyday work with PHP and Laravel. 

You will learn each of the original gang of four design patterns, and how they are relevant to modern PHP and Laravel development. Each pattern is covered with full examples of how it can be used. Written by a working developer who uses these patterns every day, you will easily be able to implement each pattern into your workflow and improve your development.

What You Will Learn 

  • How to use the original gang of four design patterns in your PHP and Laravel development 
  • How each pattern should be used 
  • How to solve problems when using the patterns
  • How to remember each pattern using mnemonics 

Who This Book Is For 

The person who will buy this book is likely using Laravel and PHP to do their job. They want to improve their understanding of design patterns.


Kelt Dockins is a humble narcissistic web developer. He works as a full stack freelancer. He specializes in quick to market web applications and minimum viable products for start ups. He has worked on small projects, medium size projects and even a few small-medium sized projects. He loves being a father, a husband and a developer. He's worked with many programming languages such as Visual Basic 6.0, c++, Java, perl, bash, prolog, .NET stack, html, css, javascript and php. For the last 3 years, he's been using php and the ever-so popular Laravel framework to stay at home and eat bacon while earning it at the same time. He does love bacon. 
Learn each of the original gang of four design patterns, and how they are relevant to modern PHP and Laravel development. Written by a working developer who uses these patterns every day, you will easily be able to implement each pattern into your workflow and improve your development. Each pattern is covered with full examples of how it can be used. Too often design patterns are explained using tricky concepts, when in fact they are easy to use and can enrich your everyday development. Design Patterns in PHP and Laravel aims to break down tricky concepts into humorous and easy-to-recall details, so that you can begin using design patterns easily in your everyday work with PHP and Laravel. This book teaches you design patterns in PHP and Laravel using real-world examples and plenty of humor.What You Will Learn Use the original gang of four designpatterns in your PHP and Laravel development How each pattern should be used Solve problems when using the patternsRemember each pattern using mnemonics Who This Book Is For People using Laravel and PHP to do their job and want to improve their understanding of design patterns.

Kelt Dockins is a humble narcissistic web developer. He works as a full stack freelancer. He specializes in quick to market web applications and minimum viable products for start ups. He has worked on small projects, medium size projects and even a few small-medium sized projects. He loves being a father, a husband and a developer. He's worked with many programming languages such as Visual Basic 6.0, c++, Java, perl, bash, prolog, .NET stack, html, css, javascript and php. For the last 3 years, he's been using php and the ever-so popular Laravel framework to stay at home and eat bacon while earning it at the same time. He does love bacon. 

Contents at a Glance 4
Contents 6
About the Author 15
About the Technical Reviewer 16
Introduction 17
Chapter 1: Laravel Basics 22
What Is Composer? 23
Meta Information 24
Dependency Management 24
Autoloading 25
Lifecycle Hooks/Scripts 25
Stability 27
Running Composer 27
Setting Up Your Environment Variable 28
Chapter 2: Let’s Grow a SOLID Garden 29
Single Responsibility Principle 29
Open/Closed Principle 30
Liskov Substitution Principle 32
Interface Segregation Principle 34
Dependency Inversion Principle 35
Conclusion 37
Single Responsibility Principle 37
Open/Closed Principle 37
Listov Substitution Principle 37
Interface Segregation Principle 37
Dependency Inversion Principle 37
Encapsulate What Varies 37
Chapter 3: Abstract Factory 38
Intent 38
Applications 38
Abstract Structure 39
Example 40
Example Structure 40
Implementation 41
Conclusion 43
Chapter 4: Builder 44
Intent 44
Applications 44
Abstract Structure 45
Example 45
Example Structure 46
Implementation 46
Conclusion 51
Chapter 5: The Factory Method 52
Intent 52
Applications 52
Abstract Structure 53
Example 53
Example Structure 53
Implementation 54
Conclusion 55
Chapter 6: Prototype 56
Intent 56
Applications 56
Abstract Structure 56
Example 57
Example Structure 57
Implementation 58
Conclusion 62
Chapter 7: Singleton 64
Intent 64
Applications 64
Abstract Structure 64
Example 65
Implementation 65
Conclusion 68
Chapter 8: Simple Factory Method 69
Intent 69
Applications 69
Abstract Structure 69
Example Scenario 70
Implementation 70
Conclusion 71
Chapter 9: Adapter 73
Intent 73
Applications 73
Abstract Structure 74
Example Scenario 75
Example Structure 75
Implementation 76
Conclusion 79
Chapter 10: Bridge 81
Intent 81
Applications 81
Abstract Structure 81
Example 82
Example Structure 82
Implementation 83
Second Example (Sending Messages) 84
Conclusion 87
Chapter 11: Composite 88
Intent 88
Applications 88
Abstract Structure 88
Example 89
Example Structure 89
Implementation 90
Conclusion 93
Chapter 12: Decorator 94
Intent 94
Applications 94
Abstract Structure 94
Example 95
Example Structure 95
Implementation 96
Presenters 99
BEFORE 99
AFTER 100
Conclusion 100
Chapter 13: Facade 101
Intent 101
Applications 101
Laravel Facades 101
Abstract Structure 102
Example 103
Example Structure 104
Implementation 105
Are Facades the Same as Adapters? 107
Conclusion 107
Chapter 14: Flyweight 108
Intent 108
Applications 108
Abstract Structure 109
Example 110
Example Structure 110
Implementation 111
The Flyweight Implementation 115
Conclusion 116
Chapter 15: Proxy 117
Intent 117
Applications 117
Abstract Structure 118
Example 118
Implementation 121
Virtual Proxy (Experiment 1 and 2) 121
Remote Proxy (Experiment 3) 123
Protection Proxy (Experiment 4) 125
Smart Proxy 127
Conclusion 128
Chapter 16: Chain of Responsibility 129
Intent 129
Applications 129
Abstract Structure 129
Example 130
Example Structure 131
Implementation 131
Conclusion 135
Chapter 17: Command 136
Intent 136
Applications 136
Abstract Structure 137
Example 138
Example Structure 138
Implementation 138
Television Command Pattern Example 142
Conclusion 146
Chapter 18: Interpreter 147
Intent 147
Applications 147
Context-Free Grammar 148
Abstract Structure 148
Example 149
Example Structure 150
Implementation 151
Dude, Where’s My Parser? 155
Conclusion 158
Chapter 19: Iterator 159
Intent 159
Applications 159
Abstract Structure 160
Example 161
Example Structure 162
Implementation 162
Laravel Collections 165
Conclusion 167
Chapter 20: Mediator 168
Intent 168
Applications 168
Abstract Structure 168
Example 169
Example Structure 170
Implementation 170
Don’t Mess with My Constructor, Man! 177
Mediator Is Not For Me 177
Not a Mediator Pattern 178
Conclusion 180
Chapter 21: Memento 181
Intent 181
Applications 181
Abstract Structure 182
Example 183
Example Structure 183
Implementation 184
Alternatives to Memento 187
Using Eloquent Methods 187
Object Serialization 189
Conclusion 190
Chapter 22: Observer 191
Intent 191
Applications 191
Abstract Structure 191
Example 192
Example Structure 192
Implementation 193
Generic Observers with SPL 193
Taylor Cuts the Cheese 195
Eloquent Observers: Out-of-the-Box Observers 198
Preventing Updates with Observers 201
Adding a Custom Observer 204
Conclusion 206
Drawbacks 207
Chapter 23: State 208
Intent 208
Applications 208
Abstract Structure 208
Example 209
Example Structure 210
Implementation: Example 1 - State Pattern 211
Example 2 - Enter State Machines 215
Example 3 221
Conclusion 223
Chapter 24: Strategy 224
Intent 224
Applications 224
Abstract Structure 224
Example 225
Example Structure 226
Implementation 227
Conclusion 229
Chapter 25: Template Method 230
Intent 230
Applications 230
Abstract Structure 230
Example 231
Example Structure 231
Implementation 232
Conclusion 234
Chapter 26: Visitor 236
Intent 236
Applications 236
Abstract Structure 237
Example 237
Example Structure 238
Implementation 238
Conclusion 241
Chapter 27: More Resources 242
Index 243

Erscheint lt. Verlag 27.12.2016
Zusatzinfo XXIII, 238 p. 76 illus., 56 illus. in color.
Verlagsort Berkeley
Sprache englisch
Themenwelt Mathematik / Informatik Informatik Web / Internet
Schlagworte Content Management • Design Patterns • dockins • larasign • Laravel • PHP • Web Development
ISBN-10 1-4842-2451-5 / 1484224515
ISBN-13 978-1-4842-2451-9 / 9781484224519
Informationen gemäß Produktsicherheitsverordnung (GPSR)
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich