HomePHP Object Interaction in PHP: Introduction to Aggregation, part 2
Object Interaction in PHP: Introduction to Aggregation, part 2
In this second part of his series, Alejandro Gervasio gets a little more technical with the basics of Aggregation. He begins working with a MySQL abstraction class and a useful paging class, and is starting to get into writing portable code and introducing the technique of aggregation.
This is the second part of the series “Object Interaction in PHP: Introduction to Aggregation”. Welcome back. In the first part of this series, we’ve taken a look at one of the most powerful processes involved within object interaction in PHP: Aggregation.
While seasoned developers use classes on a daily basis for development tasks, which implies directly establishing a careful planned interaction between objects, there are a wide range of programmers that maybe are just starting out to learn about the pros and cons of the object-oriented paradigm. With this concept in mind, by developing a pair of simple classes, we’ve hopefully demonstrated that implementing aggregation in PHP is not as difficult as it seems.
Stepping back and refreshing the concepts covered in the first part, we’ve put on test our abilities as developers, creating a couple of functional classes, that is, “arrayProcessor” and “dataMailer”, making them interact each other, in order to get around quickly in the terrain of aggregation.
Certainly, this is not a condition where you can leap straight away, expecting to know it all in no time, as you probably will agree. As all things in Life, object-oriented programming takes time, but it’s really a very exciting experience. But, what has this to do with aggregation? Everything! I know that you’re getting anxious to learn more about the topic, so let’s get on finding out how we can apply this powerful technique in websites.
In this second part, we’ll get a bit more demanding about ourselves, because we’re going to implement aggregation building two of the most frequently used classes: a MySQL abstraction class and a useful paging class, in order to provide some foundations for writing portable code and introduce our desired aggregation technique. Are you ready to launch forth into the exciting world of object interaction? Let’s get started!