Skip to content
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

Discussion: Shared Model in Core Layer vs. Module-Specific DTOs in Clean Architecture #158

Open
engamrelgazar opened this issue Dec 17, 2024 · 0 comments
Assignees
Labels
discussion This issue is used for discussing a topic.

Comments

@engamrelgazar
Copy link

Discussion: Shared Model in Core Layer vs. Module-Specific DTOs in Clean Architecture
This issue has been made to discuss the pros and cons of using a shared model in the core layer versus creating module-specific DTOs for data transfer between modules in Clean Architecture.

Summary
In Clean Architecture, one of the key decisions is how to manage and transfer data between different modules. Should we use a shared model located in the core layer, which all modules depend on, or should we create module-specific DTOs (Data Transfer Objects) for each module to ensure separation of concerns?

The decision has a significant impact on maintainability, flexibility, and scalability, as well as how tightly coupled the modules are to each other. A shared model may reduce duplication and simplify maintenance, but it could also increase coupling between modules, making the system harder to evolve. On the other hand, using DTOs for each module can lead to greater modularity and flexibility but may introduce more boilerplate code and the need for additional data transformation logic.

We'd love to hear your experiences and thoughts on the matter:

Which approach do you prefer, and why?
How do you handle data shared between modules while keeping the architecture clean and decoupled?
Do you think one approach is more suitable for large-scale applications?
Let's dive into this discussion and explore the pros and cons of each approach!

@engamrelgazar engamrelgazar added the discussion This issue is used for discussing a topic. label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion This issue is used for discussing a topic.
Projects
None yet
Development

No branches or pull requests

2 participants