pickle wrote:What would these function do?
adduser(), rmuser(), activate_user(), usernote()
Adduser - adds a new user
rmuser - removes an existing user
activate - sets the "active" flag in the user account
usernote - sets a note on the user account
pickle wrote:
Do they act on the users or the characters? If the user, you could probably make an activate() and add_note() function to the user object.
Correct - the users.
So what about the create/delete? Should I use a constructor for that?
pickle wrote:
I read somewhere that a function in an object shouldn't need to have the object name in the function name. For example, activate_user() should be called activate() if it's included in the `user` object.
Good point.
pickle wrote:
If it's just the login that uses this object, I don't think the creation and removal of the user account needs to be in an object itself. Plain code should suffice to add, remove and do other things to the user.
Well, to be honest, I was kind of trying to see if it lent itself to OOP. It seemed like a natural object, and I've been doing nothing but procedural code for several weeks now.
So, we've got object user, with activate and note. What do I use for creating and deleting the user objects?