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

Convert MongoDB Context into a Factory for Database Agnosticism #17

Open
3 tasks
iammuho opened this issue Aug 30, 2023 · 0 comments
Open
3 tasks

Convert MongoDB Context into a Factory for Database Agnosticism #17

iammuho opened this issue Aug 30, 2023 · 0 comments
Labels
enhancement New feature or request Refactor

Comments

@iammuho
Copy link
Owner

iammuho commented Aug 30, 2023

The goal of this issue is to refactor our MongoDB context into a factory pattern. This will enable us to easily switch between different database adapters without affecting the internal packages or application logic. The internal packages should be unaware of the database structure, and this refactor will help us achieve that level of abstraction.

Tasks:

  • Create an interface that defines all the methods required for data manipulation (e.g., Insert, Update, Delete, Find, etc.)
  • Implement the factory pattern to produce instances of different database adapters.
  • Refactor the existing MongoDB context to conform to the new interface.
  • Update the application logic to use the new factory and interface, replacing any direct MongoDB calls.
  • Test to ensure that the existing functionality remains intact after the refactor.

Acceptance Criteria:

  • All internal packages should be able to perform CRUD operations without being aware of the underlying database structure.
  • It should be easy to plug in a new database adapter (like MySQL, PostgreSQL, etc.) without modifying the internal packages.
  • The existing test suite should pass without any failures.
@iammuho iammuho added enhancement New feature or request Refactor labels Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Refactor
Projects
None yet
Development

No branches or pull requests

1 participant