Boost logo

Boost :

Subject: Re: [boost] [intrusive] rtti_base class proposition
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2009-10-22 01:51:50


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk