[squeak-dev] Re: My view on Traits

Ryan Mitchley ryan.mitchley at gmail.com
Fri May 16 16:52:38 UTC 2008



Sophie2 wrote:
> 
> What about
>   Y plays role R1, and role R2
> 
> e.g. a Car plays the role of TransportationVehicle and CollateralAsset.
> 
> The "state" related to these two roles are not independent: as you rack up 
> miles on the transportation vehicle, the asset collateral value drops;
> when 
> the asset is hauled away for non-payment, the transportation vehicle is
> not 
> available.
> 

It is precisely Car's function to mediate between its parts (and provide a
useful interface). The containing class provides the "glue". If the parts
have good interfaces and have been well designed, the interaction will be
well manageable. A fundamentally complex relationship would require
fundamentally complex interactions.

The interaction between TransportationVehicle>>Miles and
CollateralAsset>>Value would be radically different for, say, a Ferrari F430
and a Fiat Seicento (apologies to any offended!). It would be a function of
the particular Car instance.

I think we could agree that seizure would be physically constrained to the
Car! (that the seizor cared chiefly about the CollateralAsset is
irrelevant...)

-- 
View this message in context: http://www.nabble.com/-squeak-dev--My-view-on-Traits-tp17257352p17279430.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.




More information about the Squeak-dev mailing list