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 architecture to separate data, domain, and presentation layers #520

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

softartdev
Copy link
Owner

@softartdev softartdev commented Dec 13, 2024

Refactor the architecture of the :shared module to separate the data, domain, and presentation layers into their respective packages.

  • Data Layer:

    • Add SQLDelightSafeRepository class in the data package.
    • Add SQLDelightDatabaseSource class in the data package.
  • Domain Layer:

    • Add Note class in the domain.model package.
    • Add DatabaseState class in the domain.model package.
    • Add SafeRepository interface in the domain.repository package.
    • Add ChangePasswordUseCase, CheckPasswordUseCase, CheckSqlCipherVersionUseCase, and CreateNoteUseCase classes in the domain.usecase package.
  • Presentation Layer:

    • Add NoteListScreen class in the presentation package.
    • Add NoteDetailScreen class in the presentation package.
  • Dependency Injection:

    • Update import statements in sharedModules.kt to reflect the new package structure.
    • Update the daoModule to use the new NoteDAO location.
    • Update the useCaseModule to use the new use case locations.
    • Update the viewModelModule to use the new ViewModel locations.

For more details, open the Copilot Workspace session.

Refactor the architecture of the `:shared` module to separate the data, domain, and presentation layers into their respective packages.

* **Data Layer:**
  - Add `SQLDelightSafeRepository` class in the `data` package.
  - Add `SQLDelightDatabaseSource` class in the `data` package.

* **Domain Layer:**
  - Add `Note` class in the `domain.model` package.
  - Add `DatabaseState` class in the `domain.model` package.
  - Add `SafeRepository` interface in the `domain.repository` package.
  - Add `ChangePasswordUseCase`, `CheckPasswordUseCase`, `CheckSqlCipherVersionUseCase`, and `CreateNoteUseCase` classes in the `domain.usecase` package.

* **Presentation Layer:**
  - Add `NoteListScreen` class in the `presentation` package.
  - Add `NoteDetailScreen` class in the `presentation` package.

* **Dependency Injection:**
  - Update import statements in `sharedModules.kt` to reflect the new package structure.
  - Update the `daoModule` to use the new `NoteDAO` location.
  - Update the `useCaseModule` to use the new use case locations.
  - Update the `viewModelModule` to use the new ViewModel locations.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/softartdev/NoteDelight/tree/dev?shareId=XXXX-XXXX-XXXX-XXXX).
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

Successfully merging this pull request may close these issues.

1 participant