HomePHP Object Interaction in PHP: Introduction to Aggregation, part 4
Object Interaction in PHP: Introduction to Aggregation, part 4
In the fourth and final article in our series covering aggregation in PHP, Alejandro Gervasio reviews the MySQLConnector and Pager classes. He then uses these classes first to build a simple database, then to display some paged results from the database.
Welcome to the final part of the series “Object Interaction in PHP: Introduction to Aggregation.” Certainly, we've had some hard work, but it's been worth the gain. Implementing aggregation in PHP is one of the most powerful techniques currently available to reveal the strengths of object-oriented programming in production environments.
In the previous articles, I’ve introduced in a step-by-step process, and the concept of aggregation in an object-interactive PHP scenario, as well as its multiple possibilities for application in Web projects. The examples shown as I've guided you through the learning process have been numerous, ranging from simple, rather primitive interaction between basic classes, to more mature linkage of applications such as MySQL database abstraction and paging classes.
Particularly, jumping back into the flow of the examples given in the second and third parts respectively, where we’ve been strongly advised to develop the “MySQLConnector” abstraction class and the “Pager” paging class, we’re going to build a concrete example. This example will demonstrate how these two classes can be put together to work in existing or future applications.
Before we dive deeper into the example, a brief clarification is in order. The sample classes are designed to show clearly the interaction between objects, something that I personally recommend to novice-intermediate developers. Once you understand the core concepts and the theory, you can do more work with the wealth of open source projects widely available on the Web.
Having said that, let’s implement aggregation in our example. It’s going to be fun!