aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes How to represent a member that may or may not have to make payments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "How to represent a member that may or may not have to make payments" Watch "How to represent a member that may or may not have to make payments" New topic
Author

How to represent a member that may or may not have to make payments

Geoff Berl
Greenhorn

Joined: Apr 13, 2011
Posts: 24

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.

Thoughts???
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 5288
    
  10

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.


Junilu - [How to Ask Questions] [How to Answer Questions]
Geoff Berl
Greenhorn

Joined: Apr 13, 2011
Posts: 24

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to represent a member that may or may not have to make payments