Versions Compared

Key

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

...

The crewmember adds 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 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 the layer pattern.

Tab CRUD

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.


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 add a tab, an 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.

...