4 ms·
Database Analysts will tell you that many ORMs are themselves inner platforms, re-implementing constraints, views, joins and so on that should be encoded direct
by raganwald 15y ago
Database Analysts will tell you that many ORMs are themselves inner platforms, re-implementing constraints, views, joins and so on that should be encoded directly in the database.
- jerf 15y agoThat has become my acid test for how good an ORM is. Most fail horribly. I count myself lucky if I come across an ORM in some language that didn't visibly have joins bolted on the side in such a way that they just barely work, usually spending all the design value of the library in the project. (That is, merely by using one of these libraries you've often incurred technical debt on the spot.)
- eli 15y agoJust out of curiosity, have any passed this test?
- jerf 15y agoBased on reading the documentation, I think Hibernate for Java would qualify. I've never used it, though, so I can't be sure. SQLAlchemy for Python also looks good, but I've also never had the opportunity to use it.
- nerd_in_rage 15y agohibernate will make you throw up with all the verbosity and nonsense. sqlalchemy, on the other hand, is good.
- jquery 15y agoAll sufficiently large CRUD apps either use an established ORM or re-invent them poorly.
- fleitz 15y agoThat's not true, work with some legacy perl apps from the 90s, it's raw SQL all the way down.
- swalsh 15y agoI was quite alarmed the first time I used NHibernate with C#. I had some very non descriptive error, and the only solution I could find was removing a constraint I had created in the db.
- ajross 15y agoThe flip side to that argument is that the "M" part of the ORM can be understood an artifact of the poor storage technology, and that the ORM+database system should really be understoood as an object store with transactions, not an API layer.
- ExpiredLink 15y agoNo need to re-invent OODBMS. The had their chance - and failed.
- romaniv 15y agoORMs aren't implemented in the database, so it's less of an "inner" and more of a "parallel" platform. I think this is an important distinction, since one of the reasons people use ORMs in the first place is better integration with the programming language of their choice. Moreover, there are often practical reason to re-implement those features you've mentioned. Let's take constraints as an example. Can you use them to display a list of user-friendly validation messages when someone fills out a web form? Will they benefit from all the tools (version control, refactoring, static verification) your language of choice provides? How reusable will they be? If there were databases with language-friendly APIs for these things, I bet developers would be less likely to re-implement them.
- deleted 15y ago[deleted]