class Room{
public:
void ColorRoom(){};
};
class House{
public:
Room* GetRoom(){return &m_room;}
private:
Room m_room;
};
1) Room cannot exist without a house, an house "has a" room. (composition)
2) Another way to color room would be to have a method in House that would invoke the ColorRoom in Room method but then this is more of delegation. (i want to avoid this)
The only way I see is the one above but looks like returning reference to private member is breaking OOP. Is this a good design ?