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
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.