Ease of object creation - Referencing Core in Dto project #732
Unanswered
agfagerbakk
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
In my projects I've been referencing my Dto project, which is available to the service architecture as a package, in the Core project so that I can return it to the Web project using a service interface. Lately I've been thinking about the referencing Core project in the Dto project so that I can use class methods to create Dto objects from db entities that are more or less identical. This would move a lot of the object creation out of the Core service code and into the Dto classes/files, which would make the code base cleaner and maybe easier to use going forward.
I am mostly reluctant to create dependencies, but it feels logical to do it. I am not looking for an answer, but I would like to hear anyone's take on this and their pros and cons, especially if you have tried it.
Thanks!
EDIT
Just realized that this would cause a circular dependency. One solution would be to have a separate project that gives that solution.
Still interested to hear your thoughts!
Beta Was this translation helpful? Give feedback.
All reactions