I am trying to build UML class diagram. I am a bit new to UML so pardon my ignorance.
I have a domain class User
with these attributes:
- UserName ; data type is string ; identifier
- Password ; data type is string
- Active ; data type is bool
- Locked ; data type is bool
- PasswordExpiryDate ; data type is DateTime
So this is how I build it in UML:
Now I want to define these operations of this User
class in UML class diagram:
- Retrieve a User object by a supplied identifier from database.
- Match password of the retrieved User object with a supplied password.
- Check if the retrieved User is Active.
- Check if the retrieved User is Locked.
- Check if the retrieved User's password has expired.
- Insert a User object in database.
- Update a User object in database.
- Delete a User object from database.
So this is how I build it in UML:
But I am very confused about method #1 "Retrieve a User object by a supplied identifier from database".
All other methods are working on a single User
object which means that single User
object has already been retrieved from database or its a new object.
But method #1 make sense to work on a collection of User
objects which means all the user objects which already exist in the database.
Does it make sense? or is it a mismatch? If yes how can I fix it?
Thanks
UPDATE
Thanks for mentioning the class-level operations in UML class diagram. I did not know about them.
So I have made the changes and this is the latest UML class diagram for User
class:
Is it now correct?