Aggregation
In comparison to composition in which an object can only exist if all of its composite parts also exist, the concept of aggregation is not as strict. Instead, an aggregated object can reference other objects, but it does not need them to exist.
We can see a simple example of aggregation in action if we again reference our Car object. Unlike composition, where our car needed an engine to exist (after all, what is a car without an engine), a car can have a driver, but it does not need the driver to exist.
Let's revise our current Car.cfc
component to handle the possibility of managing a Driver object.
<cfcomponent displayname="Car" output="false" hint="I am the Car Class."> <cfproperty name="engine" type="any" default="" /> <cfproperty name="driver" type="any" default="" /> <cfset variables.instance = structNew() /> <cffunction name="init" access="public" output="false" returntype="any" hint="I am the constructor method for the Car Class."> <cfargument...