:
, , , , , . , : , . , (, , ) .
. , Steer (, CompactCar), AttachFollower (, RailwayLocomotive), (, PickupTruck). PickupTruck , , Steer, , , AttachFollower. Steer AttachFollower , PickupTruck, . , - "SteerableAndHitchable abstract class which inerits from Steerable and includes a TrailerHitch member of typeAttachable`, but such a icky thing even with two abilities. Adding more abilities in a safe type will not only require an exploding number of classes; each class will require an extension of the number of properties.
source
share