-
Notifications
You must be signed in to change notification settings - Fork 51
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
[FEATURE] 1. Add Data transfer object(DTOs) 2. use builder pattern #52
Comments
Hi @anishmu20, Thank you for expressing your interest in working on the "1. Add Data transfer object(DTOs) 2. use builder pattern" issue. I'm delighted to inform you that I have assigned this issue to you. Your willingness to contribute to our project is much appreciated. Feel free to start working, and if you have any questions or need assistance during the process, please don't hesitate to reach out. |
will this task consider under gssoc-ext ? |
Yes |
i'd like to work on this issue! i also requested on Optimize Database Queries to Reduce the Number of Calls #24 , i want to help both issues |
@anishmu20 i need to contact you, so we can work together and not on 2 different branches |
task done PULL REQUEST done i have doubt related to the project i need to discuss @ajaynegi45 . |
contact me on linkedin |
HI there, Hope you all are well, |
This is solved and you can contribute other issues or projects. all project: https://bento.me/codiescoder |
Is this feature already requested?
Problem or Missing Functionality
When an API is requested, the controller receives the request and calls the corresponding method in the service layer. The service layer contains the business logic and interacts with the repository to fetch or modify data. In this process, instead of directly exposing the entity (which represents the database structure), it is a good practice to use DTOs Data Transfer Objects to handle the data that is sent back to the client. This ensures that the internal structure of the entity is not exposed directly, enhancing security and flexibility in modifying the API's output structure without affecting the database layer.
Feature Description
Workflow
1.Controller:Receives API requests from the client.
2.Controller -> Service Layer: The controller delegates the logic execution to the service layer.
3.Service Layer: Applies business logic and interacts with the repository to modify or fetch data.
4.Repository: Interacts with the database to perform data operations.
5.DTO (Data Transfer Object): Instead of exposing the database entity directly, the service layer converts entities to DTOs, ensuring that the internal database structure is not exposed to the client.
6.Entity -> Database: The entity represents the database structure, but it's used internally without being directly exposed.
Assign me this task under gssoc-ext tag
Screenshots
No response
Would you like to work on this feature?
Yes
Implementation Plan
The plan is to first create Data Transfer Object (DTO) classes to decouple the entity from the exposed API structure. Then, modify the service layer logic to work with these DTOs, ensuring clean data handling between layers. Finally, the service layer will be refactored to use the Builder Pattern for constructing DTOs, improving flexibility and readability in object creation.
The text was updated successfully, but these errors were encountered: