• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Architecture for mutiple GUI versions

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic