PHP Objects, Patterns, and Practice- P12
Số trang: 15
Loại file: pdf
Dung lượng: 350.48 KB
Lượt xem: 11
Lượt tải: 0
Xem trước 2 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
PHP Objects, Patterns, and Practice- P12: This book takes you beyond the PHP basics to the enterprise development practices used by professional programmers. Updated for PHP 5.3 with new sections on closures, namespaces, and continuous integration, this edition will teach you about object features such as abstract classes, reflection, interfaces, and error handling. You’ll also discover object tools to help you learn more about your classes, objects, and methods.
Nội dung trích xuất từ tài liệu:
PHP Objects, Patterns, and Practice- P12 ■ INDEX naming collisions, 71, 74 centralizing common classes used in nested namespaces, declaring, 73 multiple projects, 455 PHP 5.3 and, 14, 71 class switching, 106 phpDocumentor and, 353 code duplication, 109, 454 relative namespaces, 74 code smells, 109 require_once(), 76 coding to an interface, 141, 457 switching to global space within a file, 76 cohesion, definition of, 104 unqualified name, 73 comparing to procedural programming, use keyword, 74 100, 103 using a domain name as a namespace, 73 Conf class, code listing, 51 using braces with the namespace keyword, constant properties, 44 75 Continuous Integration (CI), 460 using the as clause with use, 75 controller, 454 NastyBoss class, 146–147 copying objects with __clone(), 63 new operator, 16, 21 coupling in, 104 newInstance(), 96 create_function(), 67–68 newSelection(), 310 declaring a class or method final, 57 newUpdate(), 309–310 decoupling, definition of, 454 next(), 477 defining string values for objects, 65 nextToken(), 472–473, 477 defining the boundaries of classes, 105 Nock, Clifton, 298, 311 delegating object instantiation, 147 notes element, 336 describing a class’s responsibility, 105 Notifier class, 140 designing child classes to provide notify(), 204–205 specialized functionality, 132 notifyAccess(), 282, 298 destructor methods, 62 notifyError(), 333 devising strategies for object generation, 145, 147 notifyPasswordFailure(), 389 DomainObject class, 49 null, using in hinted arguments, 27 Employee class, 146, 148 encapsulating the concept that varies, 458 ■O encapsulation, 107–108 object lifelines, 117 Factory Method pattern, 152 object types, 25 factory, definition of, 44, 148 object-oriented design favoring composition over inheritance, 132 abstract classes, 45 final keyword, 57 Abstract Factory pattern, 157 focusing on the metasystem, 458 abstract types as enabling polymorphism, Fowler, Martin, 110 146 getAllParams(), 102 addEmployee(), 147 getInstance(), 44, 102, 104, 149 addParam(), 102 global variables, 149, 454 aesthetics of, 455 instantiating objects as a dirty business, 147 anonymous functions, 66, 68 interceptor methods, table of, 58 assigning and passing objects by reference, interfaces, 47 63 introducing dependencies in the name of automated build, 459 good design, 149 call_user_func(), 67 is_callable(), 67–68 callbacks, 66 Java and, 4502 ■ INDEX late static bindings, 49 initial rise of, in PHP, 11 leaving an overzealous class unchanged, new operator, 16, 21 109 pass-by-reference rather than pass-by-value, magic methods, 62 12–13 making code amenable to variation at PEAR and object-oriented programming, 13 runtime, 146 PHP 3 and, ...
Nội dung trích xuất từ tài liệu:
PHP Objects, Patterns, and Practice- P12 ■ INDEX naming collisions, 71, 74 centralizing common classes used in nested namespaces, declaring, 73 multiple projects, 455 PHP 5.3 and, 14, 71 class switching, 106 phpDocumentor and, 353 code duplication, 109, 454 relative namespaces, 74 code smells, 109 require_once(), 76 coding to an interface, 141, 457 switching to global space within a file, 76 cohesion, definition of, 104 unqualified name, 73 comparing to procedural programming, use keyword, 74 100, 103 using a domain name as a namespace, 73 Conf class, code listing, 51 using braces with the namespace keyword, constant properties, 44 75 Continuous Integration (CI), 460 using the as clause with use, 75 controller, 454 NastyBoss class, 146–147 copying objects with __clone(), 63 new operator, 16, 21 coupling in, 104 newInstance(), 96 create_function(), 67–68 newSelection(), 310 declaring a class or method final, 57 newUpdate(), 309–310 decoupling, definition of, 454 next(), 477 defining string values for objects, 65 nextToken(), 472–473, 477 defining the boundaries of classes, 105 Nock, Clifton, 298, 311 delegating object instantiation, 147 notes element, 336 describing a class’s responsibility, 105 Notifier class, 140 designing child classes to provide notify(), 204–205 specialized functionality, 132 notifyAccess(), 282, 298 destructor methods, 62 notifyError(), 333 devising strategies for object generation, 145, 147 notifyPasswordFailure(), 389 DomainObject class, 49 null, using in hinted arguments, 27 Employee class, 146, 148 encapsulating the concept that varies, 458 ■O encapsulation, 107–108 object lifelines, 117 Factory Method pattern, 152 object types, 25 factory, definition of, 44, 148 object-oriented design favoring composition over inheritance, 132 abstract classes, 45 final keyword, 57 Abstract Factory pattern, 157 focusing on the metasystem, 458 abstract types as enabling polymorphism, Fowler, Martin, 110 146 getAllParams(), 102 addEmployee(), 147 getInstance(), 44, 102, 104, 149 addParam(), 102 global variables, 149, 454 aesthetics of, 455 instantiating objects as a dirty business, 147 anonymous functions, 66, 68 interceptor methods, table of, 58 assigning and passing objects by reference, interfaces, 47 63 introducing dependencies in the name of automated build, 459 good design, 149 call_user_func(), 67 is_callable(), 67–68 callbacks, 66 Java and, 4502 ■ INDEX late static bindings, 49 initial rise of, in PHP, 11 leaving an overzealous class unchanged, new operator, 16, 21 109 pass-by-reference rather than pass-by-value, magic methods, 62 12–13 making code amenable to variation at PEAR and object-oriented programming, 13 runtime, 146 PHP 3 and, ...
Tìm kiếm theo từ khóa liên quan:
thủ thuật lập trình lập trình php lập trình web giáo trình cơ bản lập trình html ngôn ngữ javaGợi ý tài liệu liên quan:
-
Thủ thuật giúp giải phóng dung lượng ổ cứng
4 trang 210 0 0 -
NGÂN HÀNG CÂU HỎI TRẮC NGHIỆM THIẾT KẾ WEB
8 trang 202 0 0 -
Bài toán phân luồng giao thông và ứng dụng
11 trang 179 1 0 -
Hướng dẫn lập trình với Android part 4
5 trang 154 0 0 -
[Thảo luận] Học PHP như thế nào khi bạn chưa biết gì về lập trình?
5 trang 131 0 0 -
161 trang 129 1 0
-
142 trang 129 0 0
-
Bài giảng Lập trình web nâng cao: Chương 8 - Trường ĐH Văn Hiến
36 trang 109 1 0 -
MỘT SỐ ĐIỂM CẦN CHÚ Ý KHI THIẾT KẾ WEB
5 trang 108 0 0 -
150 trang 103 0 0