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

Extract ORM-specific logic in pragma-orm #26

Open
aldesantis opened this issue Jul 14, 2018 · 0 comments
Open

Extract ORM-specific logic in pragma-orm #26

aldesantis opened this issue Jul 14, 2018 · 0 comments

Comments

@aldesantis
Copy link
Member

aldesantis commented Jul 14, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant