-
Notifications
You must be signed in to change notification settings - Fork 8
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
Provide examples for validations and multiple dependencies #2
Comments
Hey @Lakshaya-Sood Thanks so much for your interest! I honestly wasn't expecting someone to really deep dive into this, so please forgive me if my answers seem shallow. I'll answer in the italics to as many of your questions as I can. Moreover, the current service doesn't even use the View layer of MVC. So everything lies in the model and controller. Incoming request body validation. (do we need additional modal for this) Since MongoDB 3.6, we have $jsonSchema available. Should we put database level schema validation instead of the application level? any specific reason, why you choose to use Mongoose. What do you think about MongoDB native driver? if let say StudentUseCase layer requires the use of both StudentRepository and ClassRepository, then how should multiple dependencies be passed any tips on handling a promise .then() chain when there is multiple to and fro movement of flow from use case to the repository Hope this helps somewhat. Good luck on your project. Link me to your repo (if you can) I'd love to see what you come up with! |
Hi @dcaponi
I really like your approach and yours is the only I found so close to what I was looking for.
Therefore, I am planning to migrate an existing service from SailsJs (MVC/ruby on rails philosophy based) to Onion architecture. Moreover, the current service doesn't even use the View layer of MVC. So everything lies in the model and controller.
if let say
StudentUseCase
layer requires the use of bothStudentRepository
andClassRepository
, then how should multiple dependencies be passedany tips on handling a promise
.then()
chain when there is multiple to and fro movement of flow from use case to the repositoryExample on error should bubble up till controller and logging errors with a better description
Please let me know if you forget to mention any detail. Feel free to correct me. Your suggestion are welcome 💯
The text was updated successfully, but these errors were encountered: