
22 Oct
2009
22 Oct
'09
5:31 a.m.
I agree that defining and using a common base class for all other classes in a project is in 99% of cases a very bad idea. There is a book called "C++ Gotchas: Avoiding Common Problems in Coding and Design" and the use of such "cosmic hierarchies" is a gotcha #97 ;-)
How would you model in C++ such situation:
Matus Chochlik 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 { ? }; Ireneusz Szpilewski