March 2008
Intermediate to advanced
458 pages
11h 25m
English
Now that you have seen examples of object-oriented programming in both PHP and JavaScript, it is time to revisit some examples from Chapter 2. The examples in Chapter 2 of the front, view, and business controllers, and the model were created as functions. While this works well and is fully functional, by changing the code to be object-oriented, further simplicity and greater flexibility can be achieved in larger-scale applications. Some of these objects and how they interact are shown in Figure 3-5.
As we did in Chapter 2, let’s begin with the model. The PHP example will be shown first, followed by the JavaScript example.
The purpose of the model is to hide the complexity of interacting with the data. ...
Read now
Unlock full access