Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Login

Sequence diagram login

figure 5: sequence diagram login

The loginResource should only return the response, since it's a resource and should apply the Single Responsibility rule. The loginService is an information expert, since it knows and keeps all the information from the classes. The userDAO sends a call to the database, which happens in the selectQuery method. 

...

Decision

Description

Problem/Issue

The passwords can be seen by anyone who has access to the database. This is a huge security risk.
DecisionUsing Argon2, we can hash the passwords of users, so that a hashed password is stored in the database. This prevents hackers from seeing someone elses else's password.
AlternativesSHA-512, MD5, PBKDF2, BCrypt, and SCrypt (Millington, 2022)
ArgumentsFrom a comment in Baeldung (Millington, 2022), I saw . Argon2 being suggested. Going to the Supertokens website (Supertokens Team, 2022), I found There is a tool that detects how safely a password is. With that Supertokens also recommended to use this hashing tool this in march 2022, which is quite recent. It uses more resources from your computer, but it makes a stronger password from it. Regterschot Racing required minimum security, that also includes a hashed password.

table 4: design decision login


Decision

Description

Problem/Issue

LoginService contains both the logic and sends the response
DecisionMake a new class loginResource which is responsible for only sending the response
AlternativesMake a god class
ArgumentsIf one class has to many responsibilities it doesn't obey the SOLID principle (BMC, 2022)

table 5: design decision login

View

...

Races

Sequence diagram view

...

races

Image Removed

The crewmember interacts with the ModalComponent to create a new tab. In this component, the crewmember fills in the desired rounds that they want to see data from. The system will then add the new tab with the specified rounds to the application.

View Races

Sequence diagram view races

Image Added

figure 6: sequence diagram view racesImage Removed

The crewmember goes to the rewatch race page where the front-end does a call to the back-end. This activates the getAllRaces method in the RaceResource. The resource is only responsible for returning the response so it gets delegated to the RaceService, because the resource is not allowed to have any logic in it. The RaceService decides the flow, that is why he is the controller. The RaceService delegates this to the raceDAO because getting the data from the database is not the responsibility of the service. In the RaceDAO a database connection is established to get all the data from the database. The benefit of this structure is that you can easily swap the classes which results in low cohesion and high coupling. This structure is based of the on the layer pattern.

Design decision

Decision

Description

Problem/Issue

The name of the racecar race car is not stored in the database because this is not necessary at the moment
DecisionIn the constructor of RaceDTO the car get's gets the value "BMW 320 4fl E46" assigned
AlternativesStore it in the database, leave it empty
Arguments

The BMW is the only car they intend to use in the near future so it's not necessary to make a new table for racecarrace car

table 6: design decision view races

Place Graph

Sequence diagram show sensor

figure 7: sequence diagram show sensor.

When a crewmember opens the a tab, the front-end does makes a call to the back-end. It calls a method to SensorWithGraphResource. This is the service of the SensorWithGraphDAO that gets the data which is needed for displaying graphs on the front-endsends a call to SensorWithGraphResource. The SensorWithGraphResource instantly gives it to the SensorService. That is because the SensorWithGraphResource should not contain any logic. The SensorService however is able to make send the call to the SensorWithGraphDAO. The SensorWithGraphDAO creates two DTO's. This is because the DAO uses them to send the data from the database to the resource. 

...

We decided that making a sequence diagram is not needed for this user action to the system. The sensors will get loaded in when someone navigates to the website after which the crewmember will click on the desired sensor to view a graph from. After the user clicks on the sensor, it wil will instantly show the types of graph graphs linked to the sensor. This is something that happens on the front-end, thats that's why we decided its it's unnecessary.


Sequence diagram select graph

figure 8: sequence diagram select graph.

The crewmember interacts with triggers a call on the front-end by clicking on the desired graph type. This will call a method to create the graph on the sidebar component. This is because the sidebar component is the controller. The SidebarComponent will interact with GlobalComponent because the SidebarComponent knows everything about GlobalComponent. GlobalComponent knows what is in the user's tabArray, which is why the push method on that array is called.

...

Decision

Description

Problem/Issue

There is no graph linked to a sensor.
DecisionThere won't be an available graphs to add to a tab.
AlternativesGive every sensor a normal table (for example), so there is always a graph available.
Arguments

Not every sensor has data that fits in a normal table.

table 7: design decision place graph.

Graph CRD

Sequence diagram deleteGraph

Image Added

figure 9: sequence diagram

...

Image Removeddelete graph.

The crewmember deletes a graph on the webpage. the front-end does a call to the back-end. The resource is only responsible for returning the response so it gets delegated to GraphService. The GraphService delegates this to the GraphDAO because deleting the data from the database is not the responsibility of the service. In the GraphDAO the graph gets deleted from the database. The benefit of this structure is that you can easily swap the classes which results in low cohesion and high coupling. This structure is based of the the layer pattern.

Decision

Description

Problem/Issue

graph and tab ID are not the same in the front and backend
DecisionWe use the ID from the front-end to get the right ID for the backend
AlternativesUse the ID from the database in the front-end
Arguments

Making them the same would break a lot of functionalities. We didn't have enough time so this was our only option to keep the functionalities.

Sequence diagram addGraph

Image Added

figure 10: sequence diagram add graph.Image Removed

The crewmember adds a graph on the webpage. the The front-end does makes a call to the back-end. The resource is only responsible for returning the response so it gets delegated to GraphService. The GraphService delegates this to the GraphDAO because adding the data to the database is not the responsibility of the service. In the GraphDAO the graph gets added to the database. The benefit of this structure is that you can easily swap the classes which results in low cohesion and high coupling. This structure is based of the on the layer pattern.

Tab CRUD

Delete Tab

Image Added

figure 11: sequence diagram delete tab.

The crewmember makes a call in the front end to the back-end. The TabResource receives this call and gives it instantly to the service, this is because the resource should only send something back and should not have any logic in the class. The TabService is able to make a call towards the TabDAO who can create the query to delete the tab. The service is used for this because it decides the flow of the deleting of the tab. The TabDAO sends the query to the database which deletes the tab from the storage.Image Removed


Create tab

figure 12: sequence diagram create tab.

The crewmember makes a call in the front end to the back-end. The TabResource receives this call end and sends it to the service, since the resource should only send something back and should not contain any logic. Tabresource does however receive a username from the clearToken method. This needs to happen, because the service should only delegate the function to the DAO and to succesfully successfully add a tab, an a username is required to see where the tab needs to be added. The TabDAO makes a call to the database to execute the update with a query and parameters set up in de class. This call eventually creates the tab in the database.

...