I have a simple program that can have an administrator or a regular user. The program also has two classes: for UserAccount and AdminAccount. What the administrator will have to do (use cases) includes Add_Account, Remove_Account, etc.
My question is: should I try to encapsulate these use cases in objects?
Only someone who is an administrator logged in using AdminAccount should be able to add and remove other accounts. I could have a classless subprocess that adds new UserAccount objects to the system and is called when the administrator clicks the Add Account button. Alternatively, I could place this procedure as a method inside the AdminAccount object and fire a button event, for example, "Admin.AddUser (name, password)".
I'm more inclined to the first option, but I'm not sure how far this OO business should go.
source
share