You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
ActiveRecord calls in default operations (from pragma)
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.
The text was updated successfully, but these errors were encountered:
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
andpragma-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:Pragma::ORM::AssociationEagerloading
(from pragma)Pragma::ORM::AssociationEmbedding
(from pragma-decorator)Pragma::ORM::Pagination
(from pragma-decorator)Pragma::ORM::Finder
(from pragma-contract)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.The text was updated successfully, but these errors were encountered: