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

Issue in implementation according to CLEAN Arch #6

Open
Kaaveh opened this issue Jun 15, 2022 · 4 comments
Open

Issue in implementation according to CLEAN Arch #6

Kaaveh opened this issue Jun 15, 2022 · 4 comments

Comments

@Kaaveh
Copy link

Kaaveh commented Jun 15, 2022

In data class Note in the domain, you mark it as @Entity with Room annotation. I think you involve your domain layer with data layer implementation and if you change your DB in future, your domain layer take effect.

@ootoladepaul
Copy link

please when will this issue be close?

@olukayodepaul
Copy link

olukayodepaul commented Nov 22, 2022

@Kaaveh is very correct.

Suggestion

  1. @entity should be in the data layer
  2. while the model should be in the domain layer
  3. Transform @entity from the data layer to the model in the domain layer.
_fun Notes.toNotes (): Note{
    return Note(
        title, content, timestamp, color, id
    )
}_

The Advantage of this is that, when for example we change the cache mechanism (database), the changes will only take place in the data layer not changing the model in the domain layer

@Patrulescu-Ronald-Sandrino

@olukayodepaul, could you create a PR w/ the changes?

@olukayodepaul
Copy link

@Patrulescu-Ronald-Sandrino here is the link to my repo where you can see the separation https://github.com/olukayodepaul/FaceOff

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

4 participants