Skip to content

Proposal: Introduce a Data Access Layer to improve maintainability #112

@Mohab-Sobhy

Description

@Mohab-Sobhy

Hi everyone,

While going through the codebase, I noticed that many of the controllers directly handle database operations. This approach works, but it can make the code harder to maintain, test, and extend as the project grows.

I’d like to propose introducing a Data Access Layer (DAL) (or alternatively a Repository/Service layer) to separate database logic from the controllers. Some benefits of this approach would be:

  • Improved maintainability and readability
  • Easier to add unit/integration tests
  • Cleaner separation of concerns
  • Flexibility for future changes (e.g., caching, switching databases, or handling more complex business logic)

As a first step, I could refactor a single controller to demonstrate the idea, and if it works well, we can apply the pattern to the rest of the project incrementally.

Would this be something the team is interested in exploring?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions