Home > OS >  uml - class diagram for log in and Registration
uml - class diagram for log in and Registration

Time:02-02

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

link to the question: 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

CodePudding user response:

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.

CodePudding user response:

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

  • Related