ArmedHippo. Hippo has the attributes
id and name.
inherits these attributes, and adds one of its own: number of mount points.
class ArmedHippo extends Hippo
var $num_mount_points = null;
//Load record from DB
//Save record to DB
ArmedHippo::save(). It’s in data storage methods in subclasses
like this that object-relational mapping becomes a problem. If we’re not cautious, we can
make the OOP code hard to maintain. Further, unless we carefully prepare the groundwork now,
future application updates will make things even worse.
- Recording the weight of each hippo. The simplest thing to do in PHP 4 is to change
the Hippo class, adding a new property. But can we do that without affecting
- Recording data about stealth hippos. Stealth hippos are armed hippos painted black,
and equipped with olfactory detection suppression systems (ODSS, military jargon for
deodorant). The class
Can we add it without affecting other classes?
disturbed, the more costly it will be to maintain the application.