Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Software Design: Class Diagram - User #88

Closed
6 tasks done
bahricanyesil opened this issue Apr 4, 2022 · 13 comments
Closed
6 tasks done

Software Design: Class Diagram - User #88

bahricanyesil opened this issue Apr 4, 2022 · 13 comments
Assignees
Labels
diagrams Related to use-case/class/sequence diagrams priority-high High level priority issue Status: Completed Issue is solved type-system design System design related

Comments

@bahricanyesil
Copy link
Contributor

bahricanyesil commented Apr 4, 2022

Issue Description

As the next part of the software design process, we will provide a class diagram for our project moving from the use case diagram phase. Class diagram will be completed with a collective effort and I will be preparing the user sub-section of the diagram.

  • This issue is a sub-issue of Software Design: Class Diagram #86 .

  • User class will be formed, using the following sections of the use case diagram as basis.
    Sign-Up
    Screen Shot 2022-04-04 at 12 07 07
    Login
    Screen Shot 2022-04-04 at 13 03 15

  • The class diagram will be generated using the Lucichart app, and the diagram can be viewed here .

Step Details

Steps that will be performed:

  • Check the corresponding parts of the use-case diagram
  • Define the attributes of the user class with name, type and description columns.
  • Define the methods of the user class withe name, parameters, return type and requires auth columns.
  • Check the possible inheritance, association, aggregation, composition relationships.
  • Create the diagram in our project page in Lucidchart .
  • Attach a final comment and screenshot of the diagram.

Final Actions

  • After each part of the User class is determined and combined into a diagram, it will be merged into the main class diagram provided in this link.
  • After completion, this issue will be reviewed and evaluated by the team members upon closing the issue.

Deadline of the Issue

04.04.2022 - Monday - 23.59

Reviewer

Altay Acar

Deadline for the Review

05.04.2022 - Tuesday - 10.00

@bahricanyesil bahricanyesil added priority-medium Medium level priority issue status-new New issue in initial state labels Apr 4, 2022
@bahricanyesil bahricanyesil self-assigned this Apr 4, 2022
@bahricanyesil bahricanyesil added priority-high High level priority issue diagrams Related to use-case/class/sequence diagrams type-system design System design related status-inprogress Issue is currently worked and removed priority-medium Medium level priority issue status-new New issue in initial state labels Apr 4, 2022
@bahricanyesil
Copy link
Contributor Author

bahricanyesil commented Apr 4, 2022

Info

I will benefit from my previous work in the issue #60. I will extend it, add/remove/update attributes and methods and so that it will become compatible with our current use-case diagram. I checked the use-case diagram and I will be making necessary updates.

@bahricanyesil
Copy link
Contributor Author

bahricanyesil commented Apr 4, 2022

Attributes

I defined the class attributes as follows:

Attribute Name Type Description
user_id UID Id of the user
username string Unique username of the user
email string Unique email of the user
password string Hashed password of the user
is_email_confirmed bool Whether the user is completed the email verification step
is_active bool Whether the user deleted the account and anonymized
language_code string The code of the language user is selected (if not selected, locale language code)
device_token string Token of the device which is user is actively using (will be used while sending notifications)
enabled_notification bool Whether the notifications are enabled
created_at Date The date user signed up
updated_at Date The last date information under this class is updated
deleted_at Date The date user deleted the account

@bahricanyesil
Copy link
Contributor Author

bahricanyesil commented Apr 4, 2022

Methods

I defined the class methods as follows:

Method Name Parameters Return Type Requires Auth
login username: string, password: string access_token: string, refresh_token: string, user: User false
register username: string, email: string, password: string, device_token: string, language_code: string verification_token: string false
verifyEmail verification_token: string, verification_code: string access_token: string, refresh_token: string, user: User false
sendVerificationCode email: string verification_token: string false
forgotPassword password: string void true
changePassword old_password: string, new_password: string void true
deleteUser - void true
getUser user_id: UID user: User true
setLanguage language_code: string void true
setDeviceToken device_token: string void true
hashPassword (private) password: string hashed_password: string false
changeNotificationPreference enabled_notification: bool void true
changeUsername username: string void true
checkUsername username: string bool true

@bahricanyesil
Copy link
Contributor Author

bahricanyesil commented Apr 4, 2022

Relationships

  • Can have a composition relationship with Token class that will be created with issue Software Design: Class Diagram - Token #89 and also most of the other classes like Enrollment, Participance, Profile and so on. All other classes that have composition relationship with the users should be connected to the User class by the creator of those classes.
  • Can have an inheritance relationship with Admin and other similar classes.

@bahricanyesil
Copy link
Contributor Author

I completed the user part of the class diagram. You can access it via our class diagram project link. Here's the screenshot of the corresponding part:

Screen Shot 2022-04-04 at 14 27 21

@bahricanyesil
Copy link
Contributor Author

I will add methods for following actions:

  • Hash password (private)
  • Change notification preference
  • Change username
  • Check username existence

I will also add an attribute related to the notification preference of the user.

@bahricanyesil
Copy link
Contributor Author

I added the methods and attributes I mentioned above to the diagram. You can view the updated diagram via the link above. Here's the screenshot of the updated version:

Screen Shot 2022-04-04 at 15 41 14

@bahricanyesil
Copy link
Contributor Author

The user part of the class diagram is completed, the associated diagram link and ss are given above. Now, it is ready to be reviewed by @xltvy.

@bahricanyesil bahricanyesil added status-needreview A review to the issue is needed and removed status-inprogress Issue is currently worked labels Apr 4, 2022
@xltvy xltvy added status-waitingresponse Author needs to review suggestions given. and removed status-needreview A review to the issue is needed labels Apr 4, 2022
@xltvy
Copy link
Contributor

xltvy commented Apr 4, 2022

Thank you for your very detailed and comprehensive work. I think it is nearly perfect. I think there are just a few things that can be missing. Here I listed them:

  • I think we may need an attribute for admin users. For example a boolean, called isAdmin to distinguish an admin user with a regular user.
  • I think it is more of a design choice but I came up with the question that if a User class needs lists of annotations, taken courses, notes etc. for access to a specific user's notes, annotations, taken courses etc. or not. If so, then we may add those lists to the attributes of the class.

@bahricanyesil
Copy link
Contributor Author

bahricanyesil commented Apr 4, 2022

Thank you for your very detailed and comprehensive work. I think it is nearly perfect. I think there are just a few things that can be missing. Here I listed them:

  • I think we may need an attribute for admin users. For example a boolean, called isAdmin to distinguish an admin user with a regular user.
  • I think it is more of a design choice but I came up with the question that if a User class needs lists of annotations, taken courses, notes etc. for access to a specific user's notes, annotations, taken courses etc. or not. If so, then we may add those lists to the attributes of the class.

Thank you for the review @xltvy.

1- Will there be admins of the system? If you are indicating the admin of the courses, it should be under the "enrollment" class or as a separate class. If there will be admins of the system, you're right but can you indicate the corresponding requirement/use-case diagram if that's the case.
2- I think, we will not directly store them under the user class since it will be overwhelming while creating/updating/deleting synchronously from multiple tables. Instead, we will fetch a user's notes and etc. by scanning the notes table with the id of the user since each note should have a user_id attribute. So, we don't need additional attributes for those purposes, we will use the methods of those classes (notes, annotations, and so on).

@bahricanyesil bahricanyesil added status-needreview A review to the issue is needed and removed status-waitingresponse Author needs to review suggestions given. labels Apr 5, 2022
@xltvy xltvy added status-waitingresponse Author needs to review suggestions given. and removed status-needreview A review to the issue is needed labels Apr 5, 2022
@xltvy
Copy link
Contributor

xltvy commented Apr 5, 2022

Ok, both of them makes sense and I think now we have a separate Lecture Admin class. So, first one resolved by itself. For the second one, your solution also makes sense. I just have one question about it: Where do we store tables for notes, annotations etc?

@bahricanyesil
Copy link
Contributor Author

Ok, both of them makes sense and I think now we have a separate Lecture Admin class. So, first one resolved by itself. For the second one, your solution also makes sense. I just have one question about it: Where do we store tables for notes, annotations etc?

Thank you for your response. Yes, we have a separate class for it.

For the second one:
We have the

  • "Note" class issue here
  • "Annotation" class issue here

I think there will be separate tables in the db design for the classes we created here (one-to-one relation).

@xltvy xltvy added Status: Completed Issue is solved and removed status-waitingresponse Author needs to review suggestions given. labels Apr 5, 2022
@xltvy
Copy link
Contributor

xltvy commented Apr 5, 2022

Ok, thank you. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagrams Related to use-case/class/sequence diagrams priority-high High level priority issue Status: Completed Issue is solved type-system design System design related
Projects
None yet
Development

No branches or pull requests

2 participants