
22 Oct
2009
22 Oct
'09
5:51 a.m.
Ireneusz Szpilewski wrote:
there is a Factory making plastic Cats and Dogs. They make some cats and dogs every day. Truck drivers arrive from time to time and get new products for further processing. Plastic cats and dogs are not sorted by the factory, they are mixed together and have the same price.
How the factory should be modeled?
struct Factory { ? };
you just have to have Cat and Dog inherit from FactoryProduct and not from an arbitrary cosmic base class that has no meaning in the model. That's object design 101