-
Notifications
You must be signed in to change notification settings - Fork 365
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
Refactor DAO methods #1867
Comments
With the juggler-next work in mind, would it make more sense to ensure the consistency there? |
Yeah, I agree this is probably best to defer to juggler-refactor Epic. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
Currently, DAO methods don't have a uniform way of processing and generating the result model. Ideally, the model object should be generated by a single pipeline, which would be invoked by all the DAO methods that deal with data retrieval.
Take a look at the differences in how the model data is created in the callback function of these DAO methods:
create: https://github.com/strongloop/loopback-datasource-juggler/blob/261dd1c865e8b197882a161b909b90b0e6c3c2a3/lib/dao.js#L383
save: https://github.com/strongloop/loopback-datasource-juggler/blob/261dd1c865e8b197882a161b909b90b0e6c3c2a3/lib/dao.js#L2137
replaceById: https://github.com/strongloop/loopback-datasource-juggler/blob/261dd1c865e8b197882a161b909b90b0e6c3c2a3/lib/dao.js#L2700
find: https://github.com/strongloop/loopback-datasource-juggler/blob/261dd1c865e8b197882a161b909b90b0e6c3c2a3/lib/dao.js#L1622
If DAO methods do their own thing, implementing new features or bug fixes that center around the model object will require changes for each DAO method.
The text was updated successfully, but these errors were encountered: