If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Chit Chat > App Design Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-18-03, 12:13
tkat11 tkat11 is offline
Registered User
 
Join Date: Oct 2003
Posts: 73
App Design Question

Hi yall,
I couldn't post this in any other place on this forum so I thought I'd give it a shot here.

I'm designing this application which has different kinds of users. There are admins, power users and regular users which all will have different rights. Now, when i'm drawing out my class diagram, I'm wondering if I should make each different kind of user its own class. But, if I think about it some more, the different kinds of users could almost just be an attribute of that class. For example, I could have a simple class named user and and a variable called 'isAdmin' as a boolean and that would determine if they have certain rights in the app. But the problem with this approach is that everywhere i would have to test for if 'isAdmin' is true. But wouldn't this be the same problem if i went for the every user type have its own class?
If i would create a different class for every user type, then I could make an interface that all the classes would implement and also have each class have its own unique functions. But there won't be that many AT all.

I'm just wondering how some of you work around this.

well, how bout i reword this a little.

I have several different types of users in my app. Some user groups don't have rights to change certain fields in the database. If I'm displaying the same form to every user, that means i have to do a LOT of checks like:

if user.isAdmin=true then
textbox1.visible=true
else
textbox1.visible=false


But if I make a different form for each user, thats a lot of repeated code. I know .net supports inheriting forms...but is that the route i need to take?

Your suggestions/comments would be greatly appreciated.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On