-
Book Overview & Buying
-
Table Of Contents
Learning PHP Data Objects
By :
Object-oriented programming (OOP) is a relatively new concept, although its roots date back to 1960s. In OOP, the software works with objects that model real-life entities (such as books and authors in the Chapter 7). Whereas procedural programming involves a series of instructions, an application in OOP involves a set of objects that interact with each other.
An object can be viewed as a container for several variables, called properties, and for functions that act on these variables. These functions are called methods. Every object belongs to a class. In PHP, every object can belong to only one class (although some other OOP languages allow multiple inheritance), but there can be many objects, or instances, belonging to a single class. A class is a syntactic construct that allows you to describe what properties and methods the objects belonging to this class will have.
There is an analogy with species and living organisms...
Change the font size
Change margin width
Change background colour