Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Tài liệu PHP Objects, Patterns and Practice- P1 doc
Nội dung xem thử
Mô tả chi tiết
this print for content only—size & color not accurate
CYAN
MAGENTA
YELLOW
BLACK
PANTONE 123 C
BOOKS FOR PROFESSIONALS BY PROFESSIONALS®
Matt Zandstra, Author of
Sams Teach Yourself PHP in
24 Hours
US $44.99
Shelve in:
PHP
User level:
Intermediate
www.apress.com
SOURCE CODE ONLINE
Companion eBook
See last page for details
on $10 eBook version
ISBN 978-1-4302-2925-4
9 781430 229254
5 44 9 9
PHP Objects, Patterns, and Practice THIRD EDITION
Dear Reader,
Over the past decade, PHP has embraced the object-oriented revolution. The
language itself, the developers who work with it, and the applications they build,
all increasingly share a focus on objects and object-oriented design. Another
movement, separate but related, has taken root as well. That is the use of tools
and techniques that help to ensure the success of projects, the efficacy of teams,
and the quality of code.
You’ll begin with an overview of PHP's object-oriented features, introducing
key topics like class declaration, object instantiation, inheritance, and method
and property encapsulation. You'll also learn about advanced topics including
static methods and properties, abstract classes, interfaces, exception handling,
object cloning, namespaces, closures and more.
The next part of this book is devoted to design patterns, a vocabulary for
applying elegant solutions to common problems in software development. You’ll
learn about pattern concepts and discover how to implement several key patterns in your PHP applications. You’ll also find chapters on enterprise and database patterns.
In the last section of this book, you will find practices and tools for managing
your codebase and for collaborating with others in development. These include
Phing, PHPUnit, phpDocumentor, PEAR, and Subversion. You’ll also learn how
to use Continuous Integration, a system that brings all these tools together and
automates them.
I wrote PHP Objects, Patterns, and Practice to provide the kind of overview of
code design and project practice I wish had been available when I first started to
develop serious PHP applications. I hope this book inspires pleasure in coding and
teaches you to build systems that are elegant in both design and management.
Matt Zandstra
THE APRESS ROADMAP Pro PHP:
Patterns, Frameworks,
Testing, and More
PHP Objects, Patterns, and Practice,
Third Edition
Pro
PHP Refactoring
with Test Driven Design
PHP Object-Oriented Solutions
Pro
PHP and jQuery
Practical Web 2.0 Applications
with PHP
PHP for
Absolute Beginners
Beginning
PHP and MySQL,
Third Edition
Zandstra
Companion
eBook Available
PHP Objects,
Patterns, and
Practice
7.5 x 9.25 spine = 1.000" 536 page count
THE EXPERT’S VOICE® IN OPEN SOURCE
THIRD EDITION
Matt Zandstra
Build powerful code by mastering PHP’s
object-oriented enhancements, design patterns,
and essential development tools
THIRD
EDITION PHP and Objects, Patterns, Practice
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
i
PHP Objects, Patterns,
and Practice
Third Edition
■ ■ ■
Matt Zandstra
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
ii
PHP Objects, Patterns, and Practice, Third Edition
Copyright © 2010 by Matt Zandstra
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any
means, electronic or mechanical, including photocopying, recording, or by any information
storage or retrieval system, without the prior written permission of the copyright owner and the
publisher.
ISBN-13 (pbk): 978-1-4302-2925-4
ISBN-13 (electronic): 978-1-4302-2926-1
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every
occurrence of a trademarked name, we use the names only in an editorial fashion and to the
benefit of the trademark owner, with no intention of infringement of the trademark.
President and Publisher: Paul Manning
Lead Editor: Michelle Lowman, Matt Wade
Technical Reviewer: Wes Hunt
Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell,
Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes,
Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic
Shakeshaft, Matt Wade, Tom Welsh
Coordinating Editor: Jim Markham
Copy Editor: Tracy Brown Collins
Compositor: MacPS, LLC
Indexer: Toma Mulligan
Artist: April Milne
Cover Designer: Anna Ischenko
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected],
or visit www.springeronline.com.
For information on translations, please e-mail [email protected], or visit www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional
use. eBook versions and licenses are also available for most titles. For more information, reference
our Special Bulk Sales–eBook Licensing web page at www.apress.com/info/bulksales.
The information in this book is distributed on an “as is” basis, without warranty. Although every
precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall
have any liability to any person or entity with respect to any loss or damage caused or alleged to be
caused directly or indirectly by the information contained in this work.
The source code for this book is available to readers at www.apress.com. You will need to answer
questions pertaining to this book in order to successfully download the code.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
iii
Contents at a Glance
■Contents at a Glance.......................................................................................................................iii
■Contents ..........................................................................................................................................v
■About the Author ......................................................................................................................... xvii
■About the Technical Reviewer.................................................................................................... xviii
■Acknowledgments........................................................................................................................ xix
■Introduction to the Third Edition ................................................................................................... xx
Part 1: Introduction.............................................................................................................................1
■Chapter 1: PHP: Design and Management .......................................................................................3
Part 2: Objects ....................................................................................................................................9
■Chapter 2: PHP and Objects...........................................................................................................11
■Chapter 3: Object Basics ...............................................................................................................15
■Chapter 4: Advanced Features.......................................................................................................41
■Chapter 5: Object Tools..................................................................................................................71
■Chapter 6: Objects and Design ......................................................................................................99
Part 3: Patterns...............................................................................................................................121
■Chapter 7: What Are Design Patterns? Why Use Them?..............................................................123
■Chapter 8: Some Pattern Principles ............................................................................................131
■Chapter 9: Generating Objects.....................................................................................................145
■Chapter 10: Patterns for Flexible Object Programming...............................................................169
■Chapter 11: Performing and Representing Tasks........................................................................189
■Chapter 12: Enterprise Patterns ..................................................................................................221
■Chapter 13: Database Patterns....................................................................................................275
Part 4: Practice...............................................................................................................................315
■Chapter 14: Good (and Bad) Practice ..........................................................................................317
■Chapter 15: An Introduction to PEAR and Pyrus..........................................................................323
■Chapter 16: Generating Documentation with phpDocumentor ....................................................347
■Chapter 17: Version Control with Subversion..............................................................................361
■Chapter 18: Testing with PHPUnit................................................................................................379
■Chapter 19: Automated Build with Phing ....................................................................................407
■Chapter 20: Continuous Integration.............................................................................................427
Part 5: Conclusion...........................................................................................................................451
■Chapter 21: Objects, Patterns, Practice ......................................................................................453
■Appendix A: Bibliography ............................................................................................................463
■Appendix B: A Simple Parser.......................................................................................................467
■Index............................................................................................................................................219
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.