|Published (Last):||6 February 2009|
|PDF File Size:||6.97 Mb|
|ePub File Size:||7.40 Mb|
|Price:||Free* [*Free Regsitration Required]|
Chapter 1 introduces object-oriented programming and how it fits for PHP. Some benefits of functional programming over procedural programming are highlighted. In Chapter 2 you learn to create objects and define their properties and methods. Details of classes, properties, and methods follow, along with the scope of methods. It helps you to deal with more details and some advanced features. For example you learn about class information functions, using which you can investigate details of any class.
This chapter takes you through some handy object-oriented information functions, exception handling, iterators, and storing objects using serialization.
These are an essential part of OOP and make your code more effective, better performing, and easier to maintain. Sometimes we implement these design patterns in our code without knowing that these solutions are defined by design patterns. Proper usage of the correct pattern can make your code perform better; similarly using them improperly could make your code slower and less efficient. Chapter 5 focuses on two very important features of object-oriented programming in PHP, reflection and unit testing.
One of these is the Reflection API, with which you can reverse or engineer any class or object to figure out its properties and methods. You can invoke those methods dynamically and more. Unit testing is an essential part of good, stable, and manageable application design. If you follow the guidelines provided in this chapter you will be able to design your own unit tests successfully. We focus on some specific topics that are interesting for PHP developers doing database access the OO way.
Chapter 9 : In Chapter 4 you learned how design patterns can simplify your daily life in programming by providing you with a common approach for solving problems. In this chapter we discuss the basic structure of MVC frameworks and then introduce you to some of these popular frameworks. You will learn how to build a framework in this chapter, which will also help you to understand object loading, data abstraction layers, and the importance of separation and finally you get a closer look at how applications are done.
Object-oriented programming was basically introduced to ease the development process as well as reduce the time of development by reducing the amount of code needed. OOP can greatly improve the performance of a properly planned and designed program. He is a Zend-certified Engineer and expert in developing localized applications.
He is currently working as a Technical Director in Trippert Labs and managing the local branch in Bangladesh. Hasin lives in Bangladesh with his wife Ayesha and his son, Afif. When you visit any website, it may store or retrieve information on your browser,usually in the form of cookies.
This information does not usually identify you, but it does help companies to learn how their users are interacting with the site. We respect your right to privacy, so you can choose not to accept some of these cookies.
Choose from the different category headers to find out more and change your default settings. Please note if you have arrived at our site via a cashback website, turning off targeting or performance cookies will mean we cannot verify your transaction with the referrer and you may not receive your cashback. These cookies are essential for the website to function and they cannot be turned off. They are usually only set in response to actions made by you on our site, such as logging in, adding items to your cart or filling in forms.
If you browse our website, you accept these cookies. These cookies allow us to keep track of how many people have visited our website, how they discovered us, and how they interact with the site. All the information used is aggregated, and completely anonymous. These cookies are placed on our site by our trusted third-party providers. They help us to personalise our adverts and provide services to our customers such as live chat. If you have arrived at our site via a cashback website, turning off Targeting Cookies will mean we cannot verify your transaction with the referrer and you may not receive your cashback.
Sign In Register. Toggle Nav. Browse All. All Books. Best Sellers. Top Searches:. All Videos. Skip to the end of the images gallery. Skip to the beginning of the images gallery. Read Now Look inside. Table of contents. Procedural Programming. What is MVC? Add to Cart. What do I get with a Packt subscription? What do I get with a Video? Download this Video course in MP4 format DRM FREE - read and interact with your content when you want, where you want, and how you want Immediately access your video course for viewing or download through your Packt account.
What do I get with an eBook? Add To Cart. Start a FREE day trial. Your Privacy 2. Strictly Necessary Cookies 3. Performance Cookies 4. Targeting Cookies Your Privacy. Strictly Necessary Cookies Always active. Performance Cookies. Targeting Cookies. Allow all Save. Introduction to PHP. Procedural vs. OO Coding Style.
Benefits of OOP. Dissection of an Object. Some Basic OO Terms. General Coding Conventions. Let's Bake Some Objects. Using an Object. Constructors and Destructors. Class Constants. Extending a Class [Inheritance]. Abstract Class. Static Method and Properties. Accessor Methods. Magic Methods for Overloading Class Methods.
Visually Representing a Class. Class Information Functions. Exception Handling. Array to Object. Accessing Objects in Array Style. Object Cloning. Autoloading Classes or Classes on Demand. Method Chaining. You Might have Done this Before…. Strategy Pattern. Factory Pattern. Abstract Factory. Adapter Pattern. Singleton Pattern. Iterator Pattern. Observer Pattern.
Object-Oriented Programming with Php5
By Hasin Hayder. All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals.
Object-Oriented Programming with PHP5