E-Book, Englisch, 487 Seiten
Zandstra PHP Objects, Patterns, and Practice
2. ed
ISBN: 978-1-4302-0467-1
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
E-Book, Englisch, 487 Seiten
ISBN: 978-1-4302-0467-1
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
At last - a second edition of this classic web development work. PHP Objects, Patterns, and Practice shows you how to meld the power of PHP with the sound enterprise development techniques embraced by professional programmers. Going well beyond the basics of object-oriented development, you'll learn about advanced topics such as working with static methods and properties, abstract classes, interfaces, design patterns, exception handling, and more. You'll also be exposed to key tools such as PEAR, CVS, Phing, and phpDocumentor. PHP is the most popular web development language in the world. With corporate adoption on the rise, this fully updated and enhanced edition is an essential text for webmasters.
Matt Zandstra has worked as a web programmer, consultant, and writer for nearly two decades. He is the author of SAMS Teach Yourself PHP in 24 Hours (three editions) and a contributor to DHTML Unleashed. He has written articles for Linux Magazine, Zend.com, IBM DeveloperWorks, and php|architect Magazine, among others. Matt works as a consultant advising companies on their architectures and system management, and also develops systems primarily with PHP, and Java. Matt also writes fiction.
Autoren/Hrsg.
Weitere Infos & Material
1;Contents at a Glance;5
2;Contents;7
3;About the Author;17
4;About the Technical Reviewer;18
5;Acknowledgments;19
6;Introduction to the First Edition;20
7;Introduction to the Second Edition;21
8;Introduction;22
8.1;PHP: Design and Management;23
8.1.1;The Problem;23
8.1.2;PHP and Other Languages;24
8.1.3;About This Book;26
8.1.4;Summary;28
9;Objects;29
9.1;PHP and Objects;30
9.1.1;The Accidental Success of PHP Objects;30
9.1.2;Into the Future: PHP 6;33
9.1.3;Advocacy and Agnosticism: The Object Debate;34
9.1.4;Summary;34
9.2;Object Basics;35
9.2.1;Classes and Objects;35
9.2.2;Setting Properties in a Class;37
9.2.3;Working with Methods;40
9.2.4;Arguments and Types;43
9.2.5;Inheritance;48
9.2.6;Summary;62
9.3;Advanced Features;63
9.3.1;Static Methods and Properties;63
9.3.2;Constant Properties;66
9.3.3;Abstract Classes;67
9.3.4;Interfaces;69
9.3.5;Handling Errors;71
9.3.6;Final Classes and Methods;77
9.3.7;Working with Interceptors;78
9.3.8;Defining Destructor Methods;82
9.3.9;Copying Objects with __ clone();84
9.3.10;Defining String Values for Your Objects;86
9.3.11;Summary;87
9.4;Object Tools;88
9.4.1;PHP and Packages;88
9.4.2;The Class and Object Functions;95
9.4.3;The Reflection API;101
9.4.4;Summary;112
9.5;Objects and Design;113
9.5.1;Defining Code Design;113
9.5.2;Object- Oriented and Procedural Programming;114
9.5.3;Choosing Your Classes;119
9.5.4;Polymorphism;120
9.5.5;Encapsulation;122
9.5.6;Forget How to Do It;123
9.5.7;Four Signposts;124
9.5.8;The UML;125
9.5.9;Summary;134
10;Patterns;135
10.1;What Are Design Patterns? Why Use Them?;136
10.1.1;What Are Design Patterns?;136
10.1.2;A Design Pattern Overview;138
10.1.3;The Gang of Four Format;140
10.1.4;Why Use Design Patterns?;140
10.1.5;PHP and Design Patterns;142
10.1.6;Summary;143
10.2;Some Pattern Principles;144
10.2.1;The Pattern Revelation;144
10.2.2;Composition and Inheritance;145
10.2.3;Decoupling;150
10.2.4;Code to an Interface, Not to an Implementation;152
10.2.5;The Concept That Varies;153
10.2.6;Patternitis;154
10.2.7;The Patterns;154
10.2.8;Summary;155
10.3;Generating Objects;156
10.3.1;Problems and Solutions in Generating Objects;156
10.3.2;The Singleton Pattern;160
10.3.3;Factory Method Pattern;164
10.3.4;Abstract Factory Pattern;169
10.3.5;But That's Cheating!;179
10.3.6;Summary;180
10.4;Patterns for Flexible Object Programming;181
10.4.1;Structuring Classes to Allow Flexible Objects;181
10.4.2;The Composite Pattern;182
10.4.3;The Decorator Pattern;191
10.4.4;The Facade Pattern;197
10.4.5;Summary;200
10.5;Performing and Representing Tasks;201
10.5.1;The Interpreter Pattern;201
10.5.2;The Strategy Pattern;211
10.5.3;The Observer Pattern;216
10.5.4;The Visitor Pattern;223
10.5.5;The Command Pattern;230
10.5.6;Summary;235
10.6;Enterprise Patterns;236
10.6.1;Architecture Overview;236
10.6.2;Cheating Before We Start;240
10.6.3;The Presentation Layer;250
10.6.4;The Business Logic Layer;280
10.6.5;Summary;288
10.7;Database Patterns;289
10.7.1;The Data Layer;289
10.7.2;Data Mapper;290
10.7.3;Identity Map;303
10.7.4;Unit of Work;307
10.7.5;Domain Object Factory;314
10.7.6;The Identity Object;317
10.7.7;The Selection Factory and Update Factory Patterns;323
10.7.8;What's Left of Data Mapper Now?;327
10.7.9;Summary;330
11;Practice;331
11.1;Good (and Bad) Practice;332
11.1.1;Beyond Code;332
11.1.2;Borrowing a Wheel;333
11.1.3;Playing Nice;334
11.1.4;Giving Your Code Wings;335
11.1.5;Documentation;336
11.1.6;Testing;337
11.1.7;Summary;338
11.2;An Introduction to PEAR;339
11.2.1;What Is PEAR?;340
11.2.2;Installing a Package with PEAR;341
11.2.3;Using a PEAR Package;343
11.2.4;Creating Your Own PEAR Package;348
11.2.5;Summary;362
11.3;Generating Documentation with phpDocumentor;363
11.3.1;Why Document?;363
11.3.2;Installation;364
11.3.3;Generating Documentation;365
11.3.4;DocBlock Comments;367
11.3.5;Documenting Classes;368
11.3.6;File- Level Documentation;370
11.3.7;Documenting Properties;370
11.3.8;Documenting Methods;372
11.3.9;Creating Links in Documentation;374
11.3.10;Summary;377
11.4;Version Control with CVS;378
11.4.1;Why Use Version Control?;378
11.4.2;Getting CVS;379
11.4.3;Configuring a CVS Repository;380
11.4.4;Beginning a Project;383
11.4.5;Updating and Committing;385
11.4.6;Adding and Removing Files and Directories;389
11.4.7;Tagging and Exporting a Release;392
11.4.8;Branching a Project;394
11.4.9;Summary;398
11.5;Testing with PHPUnit;399
11.5.1;Functional Tests and Unit Tests;399
11.5.2;Testing by Hand;400
11.5.3;Introducing PHPUnit;402
11.5.4;A Note of Caution;417
11.5.5;Summary;419
11.6;Automated Build with Phing;420
11.6.1;What Is Phing?;420
11.6.2;Getting and Installing Phing;421
11.6.3;Composing the Build Document;422
11.6.4;Summary;439
12;Conclusion;440
12.1;Objects, Patterns, Practice;441
12.1.1;Objects;441
12.1.2;Patterns;444
12.1.3;Practice;446
12.1.4;Summary;449
13;Appendixes;450
13.1;Bibliography;451
13.1.1;Books;451
13.1.2;Articles;452
13.1.3;Sites;452
13.2;A Simple Parser;453
13.2.1;The Scanner;453
13.2.2;The Parser;461
14;Index;475




