DTO?
DTO stands for Data Transfer Object, which is an object used in place of domain models for transferring data between layers. DTOs should purely store data and only have getters and setters for the data. DTOs should not have any business logic and should only have logic for storing, searching, serialization, and deserialization.
Process of using DTOs:
When a user inputs data, the form data is put into a DTO and then passed.
The server that receives the DTO uses DAO to insert the data into the database.
When the server sends the value to the client, it is delivered as a response DTO in the controller layer.
Reasons to use DTO instead of domain model:
By using DTO, the UI layer can pass data between the layers of the application without directly invoking methods on the domain model or changing its state.
Domain models often contain information that is not needed by a particular UI screen. DTOs can be tailored to specific UI screens and expose only the necessary information, thus reducing the risk of exposing sensitive data.
DTOs can help to separate the concerns of the different layers of an application and improve maintainability.
DTOs can be used to handle complex serialization and deserialization scenarios, where domain models may not be suitable.
Overall, using DTOs instead of domain models for data transfer between layers can help to improve the overall design and security of an application.
Then, what are DAO and VO?
DAO stands for Data Access Object, which is an object used to access data in a database. It is used to separate the logic for accessing the database from the business logic. VO, or Value Object, is often confused with DTO. It is also used to represent values, but it is read-only and immutable.
FE&BE Collaboration Project
Key factors that were crucial during the project planning phase:
Accurately drafting the API specifications: Inaccurate specifications can lead to inconsistencies in the format of data received through req and res.
Database design: Determining how to divide and link various data with different relationships into tables is crucial during the initial project planning phase.
Topics that the individual wants to study more about:
Logging error logs
Email authentication
CI/CD
Design patterns
Test code & TDD