E-Book, Englisch, 246 Seiten
Dockins Design Patterns in PHP and Laravel
1. ed
ISBN: 978-1-4842-2451-9
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
E-Book, Englisch, 246 Seiten
ISBN: 978-1-4842-2451-9
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
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.
Autoren/Hrsg.
Weitere Infos & Material
1;Contents at a Glance;4
2;Contents;6
3;About the Author;15
4;About the Technical Reviewer;16
5;Introduction;17
6;Chapter 1: Laravel Basics;22
6.1;What Is Composer?;23
6.2;Meta Information;24
6.3;Dependency Management;24
6.4;Autoloading;25
6.5;Lifecycle Hooks/Scripts;25
6.6;Stability;27
6.7;Running Composer;27
6.8;Setting Up Your Environment Variable;28
7;Chapter 2: Let’s Grow a SOLID Garden;29
7.1;Single Responsibility Principle;29
7.2;Open/Closed Principle;30
7.3;Liskov Substitution Principle;32
7.4;Interface Segregation Principle;34
7.5;Dependency Inversion Principle;35
7.6;Conclusion;37
7.6.1;Single Responsibility Principle;37
7.6.2;Open/Closed Principle;37
7.6.3;Listov Substitution Principle;37
7.6.4;Interface Segregation Principle;37
7.6.5;Dependency Inversion Principle;37
7.6.6;Encapsulate What Varies;37
8;Chapter 3: Abstract Factory;38
8.1;Intent;38
8.2;Applications;38
8.3;Abstract Structure;39
8.4;Example;40
8.5;Example Structure;40
8.6;Implementation;41
8.7;Conclusion;43
9;Chapter 4: Builder;44
9.1;Intent;44
9.2;Applications;44
9.3;Abstract Structure;45
9.4;Example;45
9.5;Example Structure;46
9.6;Implementation;46
9.7;Conclusion;51
10;Chapter 5: The Factory Method;52
10.1;Intent;52
10.2;Applications;52
10.3;Abstract Structure;53
10.4;Example;53
10.5;Example Structure;53
10.6;Implementation;54
10.7;Conclusion;55
11;Chapter 6: Prototype;56
11.1;Intent;56
11.2;Applications;56
11.3;Abstract Structure;56
11.4;Example;57
11.5;Example Structure;57
11.6;Implementation;58
11.7;Conclusion;62
12;Chapter 7: Singleton;64
12.1;Intent;64
12.2;Applications;64
12.3;Abstract Structure;64
12.4;Example;65
12.5;Implementation;65
12.6;Conclusion;68
13;Chapter 8: Simple Factory Method;69
13.1;Intent;69
13.2;Applications;69
13.3;Abstract Structure;69
13.4;Example Scenario;70
13.5;Implementation;70
13.6;Conclusion;71
14;Chapter 9: Adapter;73
14.1;Intent;73
14.2;Applications;73
14.3;Abstract Structure;74
14.4;Example Scenario;75
14.5;Example Structure;75
14.6;Implementation;76
14.7;Conclusion;79
15;Chapter 10: Bridge;81
15.1;Intent;81
15.2;Applications;81
15.3;Abstract Structure;81
15.4;Example;82
15.5;Example Structure;82
15.6;Implementation;83
15.6.1;Second Example (Sending Messages);84
15.7;Conclusion;87
16;Chapter 11: Composite;88
16.1;Intent;88
16.2;Applications;88
16.3;Abstract Structure;88
16.4;Example;89
16.5;Example Structure;89
16.6;Implementation;90
16.7;Conclusion;93
17;Chapter 12: Decorator;94
17.1;Intent;94
17.2;Applications;94
17.3;Abstract Structure;94
17.4;Example;95
17.5;Example Structure;95
17.6;Implementation;96
17.6.1;Presenters;99
17.6.1.1;BEFORE;99
17.6.1.2;AFTER;100
17.7;Conclusion;100
18;Chapter 13: Facade;101
18.1;Intent;101
18.2;Applications;101
18.3;Laravel Facades;101
18.4;Abstract Structure;102
18.5;Example;103
18.6;Example Structure;104
18.7;Implementation;105
18.7.1;Are Facades the Same as Adapters?;107
18.8;Conclusion;107
19;Chapter 14: Flyweight;108
19.1;Intent;108
19.2;Applications;108
19.3;Abstract Structure;109
19.4;Example;110
19.5;Example Structure;110
19.6;Implementation;111
19.6.1;The Flyweight Implementation;115
19.7;Conclusion;116
20;Chapter 15: Proxy;117
20.1;Intent;117
20.2;Applications;117
20.3;Abstract Structure;118
20.4;Example;118
20.5;Implementation;121
20.5.1;Virtual Proxy (Experiment 1 and 2);121
20.5.2;Remote Proxy (Experiment 3);123
20.5.3;Protection Proxy (Experiment 4);125
20.5.4;Smart Proxy;127
20.6;Conclusion;128
21;Chapter 16: Chain of Responsibility;129
21.1;Intent;129
21.2;Applications;129
21.3;Abstract Structure;129
21.4;Example;130
21.5;Example Structure;131
21.6;Implementation;131
21.7;Conclusion;135
22;Chapter 17: Command;136
22.1;Intent;136
22.2;Applications;136
22.3;Abstract Structure;137
22.4;Example;138
22.5;Example Structure;138
22.6;Implementation;138
22.6.1;Television Command Pattern Example;142
22.7;Conclusion;146
23;Chapter 18: Interpreter;147
23.1;Intent;147
23.2;Applications;147
23.2.1;Context-Free Grammar;148
23.3;Abstract Structure;148
23.4;Example;149
23.5;Example Structure;150
23.6;Implementation;151
23.6.1;Dude, Where’s My Parser?;155
23.7;Conclusion;158
24;Chapter 19: Iterator;159
24.1;Intent;159
24.2;Applications;159
24.3;Abstract Structure;160
24.4;Example;161
24.5;Example Structure;162
24.6;Implementation;162
24.6.1;Laravel Collections;165
24.7;Conclusion;167
25;Chapter 20: Mediator;168
25.1;Intent;168
25.2;Applications;168
25.3;Abstract Structure;168
25.4;Example;169
25.5;Example Structure;170
25.6;Implementation;170
25.6.1;Don’t Mess with My Constructor, Man!;177
25.6.2;Mediator Is Not For Me;177
25.6.3;Not a Mediator Pattern;178
25.7;Conclusion;180
26;Chapter 21: Memento;181
26.1;Intent;181
26.2;Applications;181
26.3;Abstract Structure;182
26.4;Example;183
26.5;Example Structure;183
26.6;Implementation;184
26.6.1;Alternatives to Memento;187
26.6.1.1;Using Eloquent Methods;187
26.6.1.2;Object Serialization;189
26.7;Conclusion;190
27;Chapter 22: Observer;191
27.1;Intent;191
27.2;Applications;191
27.3;Abstract Structure;191
27.4;Example;192
27.5;Example Structure;192
27.6;Implementation;193
27.6.1;Generic Observers with SPL;193
27.6.2;Taylor Cuts the Cheese;195
27.6.3;Eloquent Observers: Out-of-the-Box Observers;198
27.6.3.1;Preventing Updates with Observers;201
27.6.3.2;Adding a Custom Observer;204
27.7;Conclusion;206
27.7.1;Drawbacks;207
28;Chapter 23: State;208
28.1;Intent;208
28.2;Applications;208
28.3;Abstract Structure;208
28.4;Example;209
28.5;Example Structure;210
28.6;Implementation: Example 1 - State Pattern;211
28.7;Example 2 - Enter State Machines;215
28.8;Example 3;221
28.9;Conclusion;223
29;Chapter 24: Strategy;224
29.1;Intent;224
29.2;Applications;224
29.3;Abstract Structure;224
29.4;Example;225
29.5;Example Structure;226
29.6;Implementation;227
29.7;Conclusion;229
30;Chapter 25: Template Method;230
30.1;Intent;230
30.2;Applications;230
30.3;Abstract Structure;230
30.4;Example;231
30.5;Example Structure;231
30.6;Implementation;232
30.7;Conclusion;234
31;Chapter 26: Visitor;236
31.1;Intent;236
31.2;Applications;236
31.3;Abstract Structure;237
31.4;Example;237
31.5;Example Structure;238
31.6;Implementation;238
31.7;Conclusion;241
32;Chapter 27: More Resources;242
33;Index;243




