In-depth PHP: Object-oriented, model, and practice (version 2nd)

Source: Internet
Author: User

In-depth PHP: Object-oriented, model, and practice (version 2nd)


Basic Information

Author: (US) Matt zandstra
Translator: Chen Hao; Wu sunbin; Hu Dan
Series name: Turing programming Series
Press: People's post and telecommunications Press
ISBN: 9787115225788
Mounting time:
Published on: February 1, May 2010
Start: 16
Other Details View: http://www.china-pub.com/196636

Introduction

This book thoroughly analyzes the object-oriented PHP programming and design. First, we introduced PHP's OO features, including class declaration, Object Instantiation, inheritance, method and attribute encapsulation, static methods and attributes, abstract classes, interfaces, exception handling, object cloning, and other advanced topics. Then I introduced the design pattern, explained the concept of pattern, showed how to implement several key patterns in PHP, and introduced the enterprise pattern and Database pattern with special chapters. The last part of this book focuses on PHP application development. It introduces a number of extremely useful auxiliary development tools and discusses the best development practices with universal significance.
This book is an advanced reference for every PHP programmer. It helps them master the essence of PHP object-oriented design and development and become one of the top PHP programmers.

 

Directory

Part 1 Introduction
Chapter 2 PHP: Design and Management 2
1.1 Question 2
1.2 PHP and other languages 3
1.3 about Book 5
1.3.1 object 5
1.3.2 mode 5
1.3.3 Practice 6
1.3.4 new content in version 2nd of this book 7
1.4 conclusion 7
Part 2 object
Chapter 2 PHP and object 10
2.1 accidental success of PHP objects 10
2.1.1 initially: PHP/FI 10
2.1.2 syntax sugar: PHP 3 10
2.1.3 a quiet revolution: PHP 4 11
2.1.4 Embracing Change: PHP 5 12
2.2 future: Php 6 12
2.3 Support and doubts: Object debate 13
2.4 Summary 13

. Chapter 14 object Basics 14
3.1 class and object 14
3.1.1 write the first class 14
3.1.2 first object (or two) 15
3.2 set attributes in the class 15
3.3 usage 18
3.4 parameters and types 20
3.4.1 basic type 20
3.4.2 get the prompt: Object Type 23
3.5 inherit 24
3.5.1 inheritance 24
3.5.2 Use inheritance 28
3.5.3 public, private, and protected: management class access 32
3.6 summary 35
Chapter 3 advanced features 36
4.1 static methods and attributes 36
4.2 constant attribute 39
4.3 abstract class 39
4.4 interface 41
4.5 error handling 43
4.6 final classes and Methods 48
4.7 use interceptor 49
4.8 destructor method 53
4.9 use _ clone () to copy an object 54
4.10 define the string value of the object 56
4.11 summary 57
Chapter 4 object tools 58
5.1 PHP and pack 58
5.1.1 PHP and namespace 60
5.1.2 contains path 62
5.1.3 automatic loading 63
5.2 class functions and object functions 64
5.2.1 Search Class 64
5.2.2 understanding of objects or classes 65
5.2.3 understand the methods in the class 66
5.2.4 understanding of class attributes 67
5.2.5 learn about inheritance 67
5.2.6 method call 68
5.3 reflection API 69
5.3.1 entry 69
5.3.2 start action 69
5.3.3 check class 71
5.3.4 check method 72
5.3.5 check method parameter 74
5.3.6 use reflection API 75
5.4 summary 78
Chapter 2 objects and design 79
6.1 code design definition 79
6.2 object-oriented design and procedural programming 80
6.2.1 responsibilities 83
6.2.2 cohesion 83
6.2.3 coupling 83
6.2.4 orthogonal 84
6.3 select class 84
6.4 polymorphism 85
6.5 encapsulation 86
6.6 forgot details 87
6.7 four direction labels 88
6.7.1 code already exists 88
6.7.2 classes know too much. 88
6.7.3 omnipotent class 88
6.7.4 Condition Statement 89
6.8 UML 89
6.8.1 class chart 89
6.8.2 Sequence Chart 94
6.9 Conclusion 95
Part 3 mode
Chapter 1 What is the design model? Why use them 98
7.1 What is design mode 98
7.2 Design Patterns Overview 100
7.2.1 name 100
7.2.2 question 100
7.2.3 solution 101
7.2.4 effect 101
7.3 Design Pattern format 101
7.4 why use design mode 102
7.4.1 A Design Pattern Defines a problem 102
7.4.2 A Design Pattern Defines a solution 102
7.4.3 The design mode is language-independent 102
7.4.4 The mode defines a group of Vocabulary 102
7.4.5 The mode is tested 103
7.4.6 mode is designed for collaboration 103
7.4.7 design model promotes good design 103
7.5 PHP and design model 103
7.6 Conclusion 104
Chapter 1 model principles 8th
8.1 model inspiration 105
8.2 combination and inheritance 106
8.2.1 problem 106
8.2.2 combination 108
8.3 decoupling 110
8.3.1 issue 110
8.3.2 reduced coupling by 111
8.4 programming for interfaces, not for implementation 112
8.5 concept of change 113
8.6 parent-child relationship 113
8.7 mode 114
8.7.1 mode 114 for generating objects
8.7.2 mode for organizing objects and classes 114
8.7.3 task-oriented model 114
8.7.4 business model 114
8.7.5 database mode 114
8.8 conclusion 115
Chapter 1 generating objects 9th
9.1 issues and solutions for generating objects 116
9.2 Singleton mode 119
9.2.1 problem 120
9.2.2 implementation 120
9.2.3 result 122
9.3 factory method mode 122
9.3.1 Question 1 122
9.3.2 implementation 125
9.3.3 result 126
9.4 abstract factory model 127
9.4.1 Question 1 127
9.4.2 implementation 128
9.4.3 Result 129
9.4.4 prototype 131
9.4.5 problem 132
9.4.6 implementation 133
9.5 deception in some modes 134
9.6 conclusion 136
Chapter 1 more flexible Object-Oriented Programming Model 10th
10.1 construct a class with flexible object creation 137
10.2 combination mode 137
10.2.1 question 138
10.2.2 139
10.2.3 effect 143
10.2.4 Summary of combined modes 146
10.3 decoration mode 146
10.3.1 question 146
10.3.2 148
10.3.3 effect 151
10.4 appearance mode 151
10.4.1 question 152
10.4.2 153
10.4.3 effect 153
10.5 conclusion 154
Chapter 4 Execution and description of tasks 11th
11.1 interpreter mode 155
11.1.1 question 155
11.1.2 156
11.1.3 interpreter problem 162
11.2 rule mode 163
11.2.1 problem 163
11.2.2 164
11.3 observer mode 167
11.4 visitor mode 173
11.4.1 question 174
11.4.2 175
11.4.3 questions about visitor mode 178
11.5 command mode 179
11.5.1 question 179
11.5.2 179
11.6 conclusion 183
Chapter 2 Enterprise Model 12th
12.1 Architecture Overview 184
12.1.1 mode 184
12.1.2 application and layer 185
12.2 basic mode other than Enterprise Architecture 187
12.2.1 registration 187
12.2.2 implementation 188
12.3 presentation layer 196
12.3.1 front-end controller 196
12.3.2 application controller 205
12.3.3 page controller 214
12.3.4 template view and view assistant 218
12.4 business logic layer 220
12.4.1 The transaction script 221
12.4.2 domain model 225
12.5 conclusion 227
Chapter 2 database mode 13th
13.1 data layer 228
13.2 data 228
13.2.1 question 229
13.2.2 implement 229
13.2.3 result 239
13.3 ID ing 239
13.3.1 question 240
13.3.2 240
13.3.3 effect 242
13.4 unit of work 243
13.4.1 Question 1 243
13.4.2 243
13.4.3 result 246
13.4.4 delayed loading 247
13.4.5 problem 247
13.4.6 implementation 247
13.4.7 results: 249
13.5 target factories in the field 249
13.5.1 Question 1 249
13.5.2 249
13.5.3 result 250
13.6 Identify object 252
13.6.1 question 252
13.6.2 implementation 252
13.6.3 effect 256
13.7 select factory and update factory Model 257
13.7.1 Question 1 257
13.7.2 257
13.7.3 result 259
13.8 what is left in the Data er 260
13.9 conclusion 262
Part 4 practices
Chapter 5 good and bad practices 14th
14.1 exceeding code 264
14.2 borrow a wheel 264
14.3 pleasant cooperation 266
14.4 add dual-wing 267 to your code
14.5 document 267
14.6 test 268
14.7 conclusion 269
Chapter 2 pear 15th
15.1 what is pear 270
15.2 install pear package 271
15.3 use pear package 273
15.4 create your own pear package 278
15.4.1 package. xml 278
15.4.2 Composition Element 278 of package. xml
15.4.3 contents element 279
15.4.4 depends on 282
15.4.5 use phprelease for flexible custom installation 283
15.4.6 release packages 284
15.4.7 create your pear channel 284
15.5 Conclusion 288
Chapter 4 generate a document using phpbench entor 16th
16.1 why use document 289
16.2 install 290
16.3 generate document 290
16.4 docblock comment 292
16.5 Class documents 293
16.6 documentation 294
16.7 attribute document 295
16.8 method documentation 296
16.9 create link in document 297
16.10 conclusion 300
Chapter 4 Use cvs for Version Control 17th
17.1 why use version control 301
17.2 obtain CVS 302
17.3 configure the CVS code base 303
17.3.1 create code library 303
17.3.2 configure client 304
17.3.3 run CVs 304 on multiple machines
17.4 Start Project 305
17.5 update and submit 307
17.6 add and delete files and directories 309
17.6.1 add file 309
17.6.2 delete file 310
17.6.3 add directory 310
17.6.4 add binary 311
17.6.5 Delete directory 311
17.7 mark and export a project 312
17.7.1 tag project 313
17.7.2 get project code 313 through tag
17.7.3 Export Project 314
17.8 create a project branch 314
17.9 conclusion 317
Chapter 5 test with phpunit 18th
18.1 functional testing and unit testing 318
18.2 manual testing 319
18.3 introduce phpunit 321
18.3.1 creating test cases 321
18.3.2 asserted method 322
18.3.3 test exception 323
18.3.4 test suite 324
18.3.5 constraint 326
18.3.6 simulation and pile 328
18.3.7 failure as the mother of success 331
18.4 warning 333
18.5 conclusion 335
Chapter 4 Use phing to implement automatic Project
Build 336
19.1 what is phing 336
19.2 obtain and install phing 337
19.3 compile build document 337
19.3.1 objective 339
19.3.2 attribute 340
19.3.3 type 345
19.3.4 task 348
19.4 conclusion 352
Part 5 conclusion
Chapter 2 objects, models, and practices 20th
20.1 object 354
When 1.1 select 355
V1.1.2 encapsulation and delegation 355
1.1.1.3 decoupling 355
1.4 reusability 356
Aesthetics 356
20.2 mode 356
What does the ike2.1 model bring to us? 357
357 pattern and design principles
20.3 practice 359
20173.1 test 359
Article 3.2 document 359
Ike3.3 version
Ipv3.4 automatically build
What else are we missing?
20.4 conclusion 361
Part 6 Appendix
Appendix A reference 364
Appendix B simple parser 366

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.