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

Refactor DAO methods #1867

Closed
hacksparrow opened this issue Sep 21, 2020 · 5 comments
Closed

Refactor DAO methods #1867

hacksparrow opened this issue Sep 21, 2020 · 5 comments

Comments

@hacksparrow
Copy link
Contributor

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.

@dhmlau
Copy link
Member

dhmlau commented Sep 22, 2020

With the juggler-next work in mind, would it make more sense to ensure the consistency there?

cc @bajtos @raymondfeng

@bajtos
Copy link
Member

bajtos commented Sep 25, 2020

Yeah, I agree this is probably best to defer to juggler-refactor Epic.

@stale
Copy link

stale bot commented Dec 25, 2020

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.

@stale stale bot added the stale label Dec 25, 2020
@hacksparrow hacksparrow removed the stale label Dec 30, 2020
@stale
Copy link

stale bot commented Jul 14, 2021

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.

@stale stale bot added the stale label Jul 14, 2021
@stale
Copy link

stale bot commented Jul 28, 2021

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 CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants