I am trying to draw up a UML of a Gym membership program. I need Staff Members Gym Members and Yoga Members. If Yoga Members and Gym Members have monthly dues but Staff Members do not, how can I have a Staff Member that is also a Gym Member (meaning they have monthly dues now)? Or would this be a case when I would need separate classes? I was thinking I should create an interface where any member may implement PayingMember.
Have you considered not using classes to codify this particular business rule? Maybe all you need is an attribute like say, paysDues (boolean). It's always easier to start with a simple design then evolve it as more scenarios come into the picture rather than start with a complex mess and try to make sense of it all. Grow your software design little by little, always refactoring as you go.
Sadly, I did not think of that, I often over think my work. I am my own worst enemy. I will try this and see how it works out, if it doesn't, as you said, I can modify it later. Thank you.
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards