From daedddb143eab5292da851e12c11b553dd4be4fa Mon Sep 17 00:00:00 2001 From: "Jesus M. Castagnetto" Date: Sun, 4 Aug 2002 04:14:48 +0000 Subject: [PATCH] More typos and some emphasis added git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@90851 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/objaggregation/reference.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/reference/objaggregation/reference.xml b/reference/objaggregation/reference.xml index 8c191e3936..018b242884 100644 --- a/reference/objaggregation/reference.xml +++ b/reference/objaggregation/reference.xml @@ -1,5 +1,5 @@ - + Object Aggregation/Composition Functions Object Aggregation @@ -15,10 +15,11 @@ hierachies and can function as a dynamic alternative to multiple inheritance. There are two ways to perform class (and/or object) composition depending on the relationship between the composed - elements: Association and Aggregation. + elements: Association and + Aggregation. - An Association is a composition of independently constructed and + An Association is a composition of independently constructed and externally visible parts. When we associate classes or objects, each one keeps a reference to the ones it is associated with. When we associate classes statically, one class will contain a reference to an @@ -58,7 +59,7 @@ $rep = new Report(); ]]> - We call also associate instances at runtime by passing a reference in a + We can also associate instances at runtime by passing a reference in a constructor (or any othe method), which allow us to dynamically change the association relationship between objects. We will modify the example above to illustrate this point: @@ -122,7 +123,8 @@ $output = $rep->generateReport(); - Aggregation, on the other hand, implies encapsulation (hidding) of the + Aggregation, on the other hand, implies + encapsulation (hidding) of the parts of the composition. We can aggregate classes by using a (static) inner class (PHP does not yet support inner classes), in this case the aggregated class definition is not accessible, except through the class @@ -401,7 +403,7 @@ method: save - One point that we have not mention above, is that the process of + One point that we have not mentioned above, is that the process of aggregation will not override existing properties or methods in the objects. For example, the class FileStorage defines a $data property, and the class