|
Post by rubina9898 on Dec 24, 2023 5:36:51 GMT
Aproach means that the application framework is far from perfect. Certain changes and improvements will be necessary to implement before the production launch of the application built on the basis of the solution I prepared. Service The main component of the application is the class Service. The file contains the initialization of Express and the activation of the server. Additionally additional middleware is included in this file - currently I rre the data received in the query into the expected format. is also responsible for returning the response to the client in the Phone Number List appropriate format. Each implements an interface the guest list is downloaded from the repository and the result is returned. Repository The repository classes will serve as components of the data access layer. ![](https://static.wixstatic.com/media/4b6327_b4c6ae12ac534e048c9361cc1c4a573f~mv2.png/v1/fill/w_600,h_600,al_c,lg_1,q_85,enc_auto/4b6327_b4c6ae12ac534e048c9361cc1c4a573f~mv2.png) Thanks to the use of repositories the logic related to data access was isolated from the business logic contained in the controller. The controller receives a ready-made class that allows it to perform specific operations on data such as reading writing or updating. Moreover the controller does not even know what data source it is using or the structure of the stored data. Thanks to this procedure the MySQL database can be replaced with another solution without the need to modify the business logic code.
|
|