Skip to content

Extract ORM-specific logic in pragma-orm #26

Description

@aldesantis

We're starting to have a lot of ORM-dependent logic (association loading, association inclusion, record finding and pagination). Right now this logic is spread across pragma, pragma-contract and pragma-decorator, which means adding support for a new ORM requires opening PRs in three separate gems (possibly more in the future as we add more features).

Perhaps it would be a good idea to extract all ORM-dependent logic into a central pragma-orm gem that is then required in the public gems. I envision the following modules:

The downside is that the gems would bundle all ORM support features even when not all of them are used, but this seems like an acceptable tradeoff.

Another problem could be that currently the ORM support modules are tightly coupled to the gems they're part of. The most notable example of this is Pragma::Decorator::Association which performs a lot of checks on the consistency between user data and the real association. This could be solved with some sort of abstraction but it needs to be designed properly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions