unkwn
unkwn

Reputation: 83

uml - class diagram for log in and Registration

I made a class diagram for registration and login based on the answers I received in the question I asked.

link to the question: UML Class Diagram - questions on class diagram for user authentication

Class diagram: enter image description here did i understand what i needed to do ? if it's correct do i need to add a list of users in the registration class or it's not needed?


Edit: I replaced the image since I draw it on a paper

Upvotes: 0

Views: 2542

Answers (2)

qwerty_so
qwerty_so

Reputation: 36333

Supposed the Registration class is responsible for the registered users it would likely have a list of those. Either you add an (likely private) attribute or you replace this arrow (which is not an UML arrow) by an association. Put a * (top of the connector) and the role -users (below) to the left and a 1 to the right.

Then you probably need a couple of operations like userNamedLike(string):[User] to return a list of users with a similar name. The Login operation will probably need the user name (as string) and a password. So the latter should be kept in User (as encryptedPassword:string. The meaning of the registerStatus (start attributes and operations with lower char and only class names with upper) is clear as dumpling broth (at least to me).

Upvotes: 0

Christophe
Christophe

Reputation: 73587

If you want to express that a registration creates a user, you sould use a create dependency: a dashed arrow line with an open arrow head with «Create» (the guillemets are part of the syntax). Dependencies shall not have multiplicities.

I cannot tell about the list. If a registration is for temporary transaction objects, it’s ok like this. But probably, you may want to have a repository of users. This would be a class that sores the users and retrieve them by user id, of for selection criteria. This is no longer UML but domain design.

Upvotes: 0

Related Questions