• Post Reply Bookmark Topic Watch Topic
  • New Topic

Architecture for mutiple GUI versions  RSS feed

 
Chrissy Simpson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everyone. This is more of an engineering/design question but I hope that someone might have an answer. I am in the process of designing an application that has an administrator version and a participant version. The administrator version contains all participant functionality BUT the administrator has a few more options that must be distributed throughout the GUI. I am looking for an architecture to implement this without if statements all over the place and I am just not sure what the best approach is. Maybe there is a design pattern that applies but I can't think of one. Does anyone have any suggestions?
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the State pattern or State Machine apply to this problem. As your user classes have less functionality as your admin classes I would inherit the admin classes from the user classes. But that works only if the admin classes are truely user classes (= "is a" relation). The State pattern relies on inheritance.
Factory classes might help you to instantiate the right classes.
What I can recommend is: don't think to long about it before starting to actually program. After programming for some time you will realize where the code is changing a lot and where not. Apply design patterns only if they help you to concentrate changes on one place.
cheers
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!