Session Abstract JV1 |
OO and Ahh! The Power of Object Oriented PHP |
|
While PHP allows for both a procedural as well as an object-oriented coding style, today most professional PHP application packages are created using object-oriented techniques. Why? – because this results in code that is more organized, easier to maintain and extend, with fewer bugs. This session will start with a review of PHP functions and data scope – concepts that are fundamental to understanding objects. It will then cover the basics of creating classes and instantiating objects. The concepts, syntax, and terminology will be introduced using a very simple Person class, and an application that makes use of this class. We will cover constructors and other magic methods, public vs. private visibility, setter and getter methods, the "$this" object, error handling, exceptions and try/catch blocks. After covering all the basics, we'll step it up a notch and present a more realistic example: creating an HTML form input class, which can be used to build an input form for displaying and updating database record contents. This is an introductory session on OO – no prior OO experience is required, but a familiarity with PHP syntax and web application development is helpful. |
Speaker: |