To
keep it simple, when you extend an object, the object which you are extending is the
superclass of a newly extended object.
Instance: Whenever you create an object by calling its constructor, it will be called
an instance. To simplify this, whenever you write some thing like this $var = new
Object(); you actually create an instance of object class.
General Coding Conventions
We will be following some conventions in our codes throughout the book. Not being
too strict, these conventions will help you to maintain your application at a large
extent. Also, it will increase the maintainability of your code. It will also help you to
write efficient code by avoiding duplicity and redundant objects. Last but not least, it
will make your code much more readable.
OOP vs. Procedural Programming
[ 18 ]
In a single php file, we never write more than one class at a time. Out of the
scope of that class, we will not write any procedural code.
We will save any class with a proper naming convention. For example we
will save the file where we place the Emailer class introduced earlier in this
chapter as class.emailer.php. What benefits can you achieve using this
naming convention? Well, without going inside that file, you are now at least
confirmed that this file contains a class named "Emailer".
Pages:
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37