Inheritance is not always the answer. It makes sense if there is an is-a relationship involved, but often times the relationship is really has-a. A has-a relationship is better served through composition. In the OP's case, he's implementing a kind of poor man's composition, in that his main code is the "object" that has-a copy of the sub object.