I am interested in writing a clean domain model of rubies and adding persistence in the future.
Some tools that I used with other languages, such as the Microsoft Entity Framework, now allow you to use simple objects for your domain data models, and then add them to the persistence class later using conventions-based matching. For example, these simple objects:
The database context classes are added here:
This can be very useful not only to separate problems during testing, but also allows you to use more manageable code, compliance with SRP and the ability to easily change your save level if necessary.
I can’t find anything that fits the bill right now ORM-wise in the ruby sphere. ActiveRecord, DataMapper and Sequel all inherit from the base class tied to these frameworks. Are there any projects, alternative methods or methods to achieve this?
source share