Muutke küpsiste eelistusi

PHP Objects, Patterns, and Practice 5th ed. [Pehme köide]

  • Formaat: Paperback / softback, 576 pages, kõrgus x laius: 254x178 mm, kaal: 1141 g, 27 Illustrations, color; 72 Illustrations, black and white; XXVII, 576 p. 99 illus., 27 illus. in color., 1 Paperback / softback
  • Ilmumisaeg: 20-Dec-2016
  • Kirjastus: APress
  • ISBN-10: 1484219953
  • ISBN-13: 9781484219959
Teised raamatud teemal:
  • Pehme köide
  • Hind: 84,24 €*
  • * saadame teile pakkumise kasutatud raamatule, mille hind võib erineda kodulehel olevast hinnast
  • See raamat on trükist otsas, kuid me saadame teile pakkumise kasutatud raamatule.
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Lisa soovinimekirja
  • Formaat: Paperback / softback, 576 pages, kõrgus x laius: 254x178 mm, kaal: 1141 g, 27 Illustrations, color; 72 Illustrations, black and white; XXVII, 576 p. 99 illus., 27 illus. in color., 1 Paperback / softback
  • Ilmumisaeg: 20-Dec-2016
  • Kirjastus: APress
  • ISBN-10: 1484219953
  • ISBN-13: 9781484219959
Teised raamatud teemal:
The 5th edition of this popular book has been fully updated for PHP 7, including replacing the PEAR package manager with Composer, and new material on Vagrant and PHP standards. It provides a solid grounding in PHP's support for objects, it builds on this foundation to instill core principles of software design and then covers the tools and practices needed to develop, test and deploy robust code.

PHP Objects, Patterns, and Practice begins by covering PHP's object-oriented features. It introduces key topics including class declaration, inheritance, reflection and much more.

The next section is devoted to design patterns. It explains the principles that make patterns powerful. The book covers many of the classic design patterns and includes chapters on enterprise and database patterns.

The last segment of the book covers the tools and practices that can help turn great code into a successful project. The section shows how to manage multiple developers and releases with git, how to manage builds and dependencies with Composer. It also explores strategies for automated testing and continuous integration.
 
Taken together these three elements: object fundamentals, design principles, and best practice will help the reader develop elegant and rock solid systems.

PHP Objects, Patterns, and Practice:
  • Describes and demonstrates PHP's built-in object-oriented features
  • Breaks down the principles of object-oriented design, explaining key design patterns using practical examples.
  • Discusses the tools and practices necessary for developing, testing and deploying exemplary applications.

What You'll Learn:
  • How to work with object fundamentals: writing classes and methods, instantiating objects, creating powerful class hierarchies using inheritance.
  • Master advanced object-oriented features, including static methods and properties, managing error conditions with exceptions, and creating abstract classes and interfaces.
  • Learn about the new object-oriented features introduced by PHP 7 and why they matter for your code.
  • Understand and use design principles to deploy objects and classes effectively in your projects.
  • Learn about design patterns, their purpose, structure and the underlying principles that govern them. Discover a set of powerful patterns that you can deploy in your own projects.
  • Learn about the tools and practices that can guarantee a successful project including unit testing; version control, build, installation and package management; and continuous integration.

Who This Book is For:

This book is suitable for anyone with at least a basic knowledge of PHP who wants to use its object-oriented features in their projects. 

Those who already know their interfaces from their abstracts may well still find it hard to use these features in their systems. They will benefit from the book's emphasis on design. They will learn how to choose and combine the participants of a system; how to read design patterns and how to use them in their code. 

Finally this book is for PHP coders who want to learn about the practices and tools (version control, testing, continuous integration, etc) that can make projects safe, elegant and stable.

About the Author xxi
About the Tecnical Reviewer xxiii
Acknowledgments xxv
Introduction xxvii
Part I Objects
1(154)
Chapter 1 PHP: Design and Management
3(6)
The Problem
3(1)
PHP and Other Languages
4(2)
About This Book
6(2)
Objects
6(1)
Patterns
6(1)
Practice
6(1)
What's New in the Fifth Edition
7(1)
Summary
8(1)
Chapter 2 PHP and Objects
9(6)
The Accidental Success of PHP Objects
9(3)
In the Beginning: PHP/FI
9(1)
Syntactic Sugar: PHP 3
9(1)
PHP 4 and the Quiet Revolution
10(1)
Change Embraced: PHP 5
11(1)
PHP 7: Closing the Gap
12(1)
Advocacy and Agnosticism: The Object Debate
12(1)
Summary
13(2)
Chapter 3 Object Basics
15(32)
Classes and Objects
15(2)
A First Class
15(1)
A First Object (or Two)
16(1)
Setting Properties in a Class
17(2)
Working with Methods
19(3)
Creating a Constructor Method
21(1)
Arguments and Types
22(8)
Primitive Types
22(4)
Taking the Hint: Object Types
26(4)
Inheritance
30(16)
The Inheritance Problem
30(5)
Working with Inheritance
35(6)
Public, Private, and Protected: Managing Access to Your Classes
41(5)
Summary
46(1)
Chapter 4 Advanced Features
47(52)
Static Methods and Properties
47(4)
Constant Properties
51(1)
Abstract Classes
51(2)
Interfaces
53(2)
Traits
55(10)
A Problem for Traits to Solve
56(1)
Defining and Using a Trait
57(1)
Using More than One Trait
58(1)
Combining Traits and Interfaces
58(1)
Managing Method Name Conflicts with insteadof
59(2)
Aliasing overridden trait methods
61(1)
Using static methods in traits
61(1)
Accessing Host Class Properties
62(1)
Defining Abstract Methods in Traits
63(1)
Changing Access Rights to Trait Methods
64(1)
Late Static Bindings: The static Keyword
65(3)
Handling Errors
68(9)
Exceptions
70(7)
Final Classes and Methods
77(1)
The Internal Error Class
78(1)
Working with Interceptors
79(6)
Defining Destructor Methods
85(2)
Copying Objects with-clone()
87(3)
Defining String Values for Your Objects
90(1)
Callbacks, Anonymous Functions, and Closures
91(4)
Anonymous Classes
95(2)
Summary
97(2)
Chapter 5 Object Tools
99(34)
PHP and Packages
99(13)
PHP Packages and Namespaces
99(9)
Autoload
108(4)
The Class and Object Functions
112(7)
Looking for Classes
113(1)
Learning About an Object or Class
113(2)
Getting a Fully Qualified String Reference to a Class
115(1)
Learning About Methods
115(2)
Learning About Properties
117(1)
Learning About Inheritance
117(1)
Method Invocation
118(1)
The Reflection API
119(12)
Getting Started
120(1)
Time to Roll up Your Sleeves
120(2)
Examining a Class
122(2)
Examining Methods
124(2)
Examining Method Arguments
126(1)
Using the Reflection API
127(4)
Summary
131(2)
Chapter 6 Objects and Design
133(22)
Defining Code Design
133(1)
Object-Oriented and Procedural Programming
134(5)
Responsibility
138(1)
Cohesion
138(1)
Coupling
139(1)
Orthogonality
139(1)
Choosing Your Classes
139(1)
Polymorphism
140(2)
Encapsulation
142(1)
Forget How to Do It
142(1)
Four Signposts
143(1)
Code Duplication
143(1)
The Class Who Knew Too Much
143(1)
The Jack of All Trades
144(1)
Conditional Statements
144(1)
The UML
144(9)
Class Diagrams
144(7)
Sequence Diagrams
151(2)
Summary
153(2)
Part II Patterns
155(220)
Chapter 7 What Are Design Patterns? Why Use Them?
157(8)
What Are Design Patterns?
157(2)
A Design Pattern Overview
159(1)
Name
159(1)
The Problem
159(1)
The Solution
159(1)
Consequences
160(1)
The Gang of Four Format
160(1)
Why Use Design Patterns?
161(1)
A Design Pattern Defines a Problem
161(1)
A Design Pattern Defines a Solution
161(1)
Design Patterns Are Language Independent
161(1)
Patterns Define a Vocabulary
161(1)
Patterns Are Tried and Tested
162(1)
Patterns Are Designed for Collaboration
162(1)
Design Patterns Promote Good Design
162(1)
Design Patterns are Used By Popular Frameworks
162(1)
PHP and Design Patterns
162(1)
Summary
163(2)
Chapter 8 Some Pattern Principles
165(14)
The Pattern Revelation
165(1)
Composition and Inheritance
166(6)
The Problem
166(3)
Using Composition
169(3)
Decoupling
172(3)
The Problem
172(1)
Loosening Your Coupling
173(2)
Code to an Interface, Not to an Implementation
175(1)
The Concept that Varies
176(1)
Patternitis
177(1)
The Patterns
177(1)
Patterns for Generating Objects
177(1)
Patterns for Organizing Objects and Classes
177(1)
Task-Oriented Patterns
177(1)
Enterprise Patterns
178(1)
Database Patterns
178(1)
Summary
178(1)
Chapter 9 Generating Objects
179(32)
Problems and Solutions in Generating Objects
179(5)
The Singleton Pattern
184(3)
The Problem
184(1)
Implementation
185(2)
Consequences
187(1)
Factory Method Pattern
187(6)
The Problem
188(3)
Implementation
191(2)
Consequences
193(1)
Abstract Factory Pattern
193(6)
The Problem
194(1)
Implementation
195(2)
Consequences
197(2)
Prototype
199(4)
The Problem
199(1)
Implementation
200(3)
Pushing to the Edge: Service Locator
203(2)
Splendid Isolation: Dependency Injection
205(4)
The Problem
205(1)
Implementation
206(2)
Consequences
208(1)
Summary
209(2)
Chapter 10 Patterns for Flexible Object Programming
211(24)
Structuring Classes to Allow Flexible Objects
211(1)
The Composite Pattern
211(11)
The Problem
212(2)
Implementation
214(4)
Consequences
218(4)
Composite in Summary
222(1)
The Decorator Pattern
222(7)
The Problem
222(3)
Implementation
225(4)
Consequences
229(1)
The Facade Pattern
229(4)
The Problem
230(1)
Implementation
231(1)
Consequences
232(1)
Summary
233(2)
Chapter 11 Performing and Representing Tasks
235(42)
The Interpreter Pattern
235(10)
The Problem
235(1)
Implementation
236(9)
Interpreter Issues
245(1)
The Strategy Pattern
245(5)
The Problem
246(1)
Implementation
247(3)
The Observer Pattern
250(9)
Implementation
253(6)
The Visitor Pattern
259(8)
The Problem
259(2)
Implementation
261(5)
Visitor Issues
266(1)
The Command Pattern
267(5)
The Problem
267(1)
Implementation
267(5)
The Null Object Pattern
272(4)
The Problem
272(3)
Implementation
275(1)
Summary
276(1)
Chapter 12 Enterprise Patterns
277(50)
Architecture Overview
277(3)
The Patterns
277(1)
Applications and Layers
278(2)
Cheating Before We Start
280(6)
Registry
280(2)
Implementation
282(4)
The Presentation Layer
286(31)
Front Controller
286(11)
Application Controller
297(13)
Page Controller
310(5)
Template View and View Helper
315(2)
The Business Logic Layer
317(9)
Transaction Script
318(4)
Domain Model
322(4)
Summary
326(1)
Chapter 13 Database Patterns
327(48)
The Data Layer
327(1)
Data Mapper
327(16)
The Problem
328(1)
Implementation
328(14)
Consequences
342(1)
Identity Map
343(4)
The Problem
343(1)
Implementation
344(3)
Consequences
347(1)
Unit of Work
347(8)
The Problem
348(1)
Implementation
348(4)
Consequences
352(1)
Lazy Load
352(1)
The Problem
352(1)
Implementation
353(2)
Consequences
355(1)
Domain Object Factory
355(4)
The Problem
355(1)
Implementation
356(1)
Consequences
357(2)
The Identity Object
359(6)
The Problem
359(1)
Implementation
359(6)
Consequences
365(1)
The Selection Factory and Update Factory Patterns
365(5)
The Problem
366(1)
Implementation
366(4)
Consequences
370(1)
What's Left of Data Mapper Now?
370(3)
Summary
373(2)
Part III Practice
375(190)
Chapter 14 Good (and Bad) Practice
377(8)
Beyond Code
377(1)
Borrowing a Wheel
378(1)
Playing Nice
379(1)
Giving Your Code Wings
380(1)
Standards
380(1)
Vagrant
381(1)
Testing
381(1)
Continuous Integration
382(1)
Summary
383(2)
Chapter 15 PHP Standards
385(14)
Why Standards?
385(1)
What Are PHP Standards Recommendations?
386(1)
Why PSR in Particular?
386(1)
Who Are PSRs for?
387(1)
Coding with Style
387(8)
PSR-1 Basic Coding Standard
388(2)
PSR-2 Coding Style Guide
390(3)
Checking and Fixing your Code
393(2)
PSR-4 Autoloading
395(3)
The Rules that Matter to Us
395(3)
Summary
398(1)
Chapter 16 PHP Using and Creating Components with Composer
399(12)
What Is Composer?
399(1)
Installing Composer
400(1)
Installing a (Set of) Package(s)
400(3)
Installing a Package from the Command Line
401(1)
Versions
401(1)
require-dev
402(1)
Composer and Autoload
403(1)
Creating Your Own Package
404(2)
Adding Package Information
404(1)
Platform Packages
405(1)
Distribution Through Packagist
406(3)
Keeping it private
409(1)
Summary
410(1)
Chapter 17 Version Control with Git
411(24)
Why Use Version Control?
411(1)
Getting Git
412(1)
Using an Online Git Repository
413(2)
Configuring a Git Server
415(2)
Creating the Remote Repository
415(2)
Beginning a Project
417(3)
Cloning the Repository
420(1)
Updating and Committing
420(4)
Adding and Removing Files and Directories
424(2)
Adding a File
424(1)
Removing a File
424(1)
Adding a Directory
425(1)
Removing Directories
425(1)
Tagging a Release
426(1)
Branching a Project
427(6)
Summary
433(2)
Chapter 18 Testing with PHPUnit
435(30)
Functional Tests and Unit Tests
435(1)
Testing by Hand
436(2)
Introducing PHPUnit
438(14)
Creating a Test Case
439(2)
Assertion Methods
441(1)
Testing Exceptions
442(1)
Running Test Suites
443(1)
Constraints
444(2)
Mocks and Stubs
446(3)
Tests Succeed When They Fail
449(3)
Writing Web Tests
452(11)
Refactoring a Web Application for Testing
452(2)
Simple Web Testing
454(2)
Introducing Selenium
456(7)
A Note of Caution
463(1)
Summary
464(1)
Chapter 19 Automated Build with Phing
465(22)
What Is Phing?
465(1)
Getting and Installing Phing
466(1)
Composing the Build Document
466(19)
Targets
468(2)
Properties
470(7)
Types
477(5)
Tasks
482(3)
Summary
485(2)
Chapter 20 Vagrant
487(10)
The Problem
487(1)
A Little Setup
488(2)
Choosing and Installing a Vagrant Box
488(2)
Mounting Local Directories on the Vagrant Box
490(1)
Provisioning
491(4)
Setting Up the Web Server
492(1)
Setting Up MySQL
493(1)
Configuring a Host Name
494(1)
Wrapping It Up
495(1)
Summary
496(1)
Chapter 21 Continuous Integration
497(28)
What Is Continuous Integration?
497(26)
Preparing a Project for CI
498(11)
Installing Jenkins Plug-ins
509(2)
Setting up the Git Public Key
511(1)
Installing a Project
511(5)
Running the First Build
516(1)
Configuring the Reports
517(3)
Triggering Builds
520(3)
Summary
523(2)
Chapter 22 Objects, Patterns, Practice
525(10)
Objects
525(2)
Choice
526(1)
Encapsulation and Delegation
526(1)
Decoupling
526(1)
Reusability
527(1)
Aesthetics
527(1)
Patterns
527(3)
What Patterns Buy Us
528(1)
Patterns and Principles of Design
529(1)
Practice
530(3)
Testing
530(1)
Standards
531(1)
Version Control
531(1)
Automated Build
531(1)
Continuous Integration
532(1)
What I Missed
532(1)
Summary
533(2)
Chapter 23 Appendix A: Bibliography
535(4)
Books
535(1)
Articles
535(1)
Sites
536(3)
Chapter 24 Appendix B: A Simple Parser
539(26)
The Scanner
539(9)
The Parser
548(17)
Index 565
Matt Zandstra has worked as a web programmer, consultant, and writer for over 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, IBM DeveloperWorks, and php|architect Magazine, among others. Matt was a senior developer/tech lead at Yahoo and API tech lead at LoveCrafts. 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.