3 ms·
In my opinion, what's actually needed is to realise that object orientation is a dead end. We need relational programming languages. ORMs can't work for a simp
by jacques_chester 13y ago
In my opinion, what's actually needed is to realise that object orientation is a dead end. We need relational programming languages.
ORMs can't work for a simple reason. They are trying to map from the world of sets into the world of graphs. Sets are more expressive, so there is always a good chance that there will be a lossy transformation.
This remark constitutes 100% of your RDA of cryptic ranting.
- auvrw 13y agototal tangent, but in defense of graphs: it's worth noting that graphs are actually a lot more expressive than they might appear at first glance. it's possible to interpret linear orders, algebraic groups, or any other theory written in finite language with graph theory (according to Marker's book on model theory, which references Hodges' for details on the proof)
- jacques_chester 13y agoNot tangential at all and I while I hate being wrong, I like learning new things. Graphs are very expressive. But most of the time, when you try to express the domain model as a tree (inheritance) it leads to muddiness because most domain models are not truly tree-like. Then we try to express it as graphs (composition), but that gives up the advantages of hierarchy. If you instead express things as sets and subsets, you can enjoy the advantages of both inheritance (DRY logic) and composition (numerous). Some languages kinda sorta have this through mixins or modules. But not quite.
- mindcrime 13y agoORMs can't work for a simple reason. But they do. They work every freaking day, in millions of applications, all over the world. I think it would be more correct to say "ORM's can't work perfectly for every conceivable scenario involving an RDBMS". But they certainly can, and do, work for many, many use cases. They are trying to map from the world of sets into the world of graphs. Sets are more expressive, so there is always a good chance that there will be a lossy transformation. But if you started with a graph, transform it to the more expressive set world, then transform it back to a graph, why would you lose anything? And in my experience that's usually the way ORM's are used... to persist an object-graph and then query/retrieve parts of that graph. Now if you're taking an existing schema, developed for different usage patterns, and trying to layer on top of it with an ORM, then, yes, you should expect problems. We need relational programming languages. That's an interesting idea. What would such a language look like?
- dragonwriter 13y ago> In my opinion, what's actually needed is to realise that object orientation is a dead end. We need relational programming languages. The second part is true, the first is not. While certain popular OO programming languages and SQL are limited in incompatible ways (creating the so-called "object-relational impedance mismatch", which is more properly the "certain-OO-languages-to-SQL-impedance-mismatch"), there is no inherent mismatch between the OO and relational models, and there is no reason you can't have both in the same language. This is pretty central to Date and Darwen's Third Manifesto [1] and the languages that implement the features it requires of "D" [2]. [1] http://www.dcs.warwick.ac.uk/~hugh/TTM/TTM-2013-02-07.pdf http://www.dcs.warwick.ac.uk/~hugh/TTM/TTM-2013-02-07.pdf [2] http://en.wikipedia.org/wiki/D_(data_language_specification) http://en.wikipedia.org/wiki/D_(data_language_specification)