3 ms·
> I don't want to go back to the time where you had to write object definitions for each table the database, and manually sync them. Sure. Though I'd love if O
by TeMPOraL 8y ago
> I don't want to go back to the time where you had to write object definitions for each table the database, and manually sync them.
Sure. Though I'd love if ORMs would seal autogenerated classes to prevent inheriting from them, language allowing, or otherwise prevent people from using generated ActiveRecord objects as their business model objects. ORMs should be just for creating an OO view into relational storage. They should not be running business logic. I know that people worry about having to write another set of classes just to wrap the ORM ones, but really, sooner or later (usually sooner) your business logic abstractions will stop mapping 1:1 to storage needs, and then you'll be wishing you had that extra layer of separation.
Or, in other words, treat ORMs as a more verbose and somewhat-compile-time-checked SQL. Nothing more.
- icebraining 8y agoI've had that problem, but frankly it was easier to make an hybrid (mostly ActiveRecord with a few "weird" classes that delegated their own storage) than to write a full Data Mapper layer.