Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 7
    If each of the classes implemented interfaces, and you extracted the common attributes out of each one, you could have your new class implement Member and Employee, contain the right instances of the common classes plus the extra ones you need, and delegate. Commented Jan 24, 2009 at 1:09
  • 4
    Your concern, which is valid, is an argument for the 2nd design, not an argument against both. Commented Oct 3, 2015 at 15:44
  • public class EmployedMember: Employee, Member, assuming your language supports multiple ancestors. Of course, trouble starts when both classes use Id instead of EmployeeId and MemberId respectively... Commented Feb 16, 2017 at 9:59
  • Someone who is both a member and an employee is like someone who is both a moderator and an admin. It's not a very bright idea. Commented May 20, 2017 at 14:37