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

Decouple database model from business logic models #5

Open
volmedo opened this issue Nov 6, 2021 · 0 comments
Open

Decouple database model from business logic models #5

volmedo opened this issue Nov 6, 2021 · 0 comments

Comments

@volmedo
Copy link
Owner

volmedo commented Nov 6, 2021

Currently, the Chat model used to represent a chat in the service's business logic is also used to unmarshal data records. This implies that database fields have to have the same names than the ones defined in the service model.

A possible solution would be to add struct tags to the Chat model so that the records are parsed correctly. However, that would mean adding repository-specific details to a logic model. Ideally, both should be fully decoupled, even if that implies implementing parsing routines to translate between them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant