Earlier quoted context omitted.
I think the comparison to Vietnam makes sense as an analogy . The basic argument seems to be that each ORM imposes limitations specific to that implementation which may result in the developer's choices being limited later on in the development process - just as early strategic decisions in a war can predetermine the outcome and potentially result in 'quagmire'. It's an argument that seems to echo Joel's idea of "lea…
The arguments in Atwood's and Neward's articles stand well on their own. The war analogy is there as link bait.
Object-Relational Mapping is the Vietnam of Computer Science
11–20 of 29 posts
Re: Object-Relational Mapping is the Vietnam of Computer Science
#12Re: Object-Relational Mapping is the Vietnam of Computer Science
#13Earlier quoted context omitted.
How do you map the types if the rows are returned as dicts? Doesn't that become an application responsibility? By using an ORM you would not need to build that functionality, i.e. reinvent the wheel. Did you consider using SQLObject or SQLAlchemy? If so, I'd be curious to know why you decided against using them?
There are lots of ways to do this. A most common approach is to have each of those dicts be a first class object in python/blub, and therefore you know the class of the object. Customer.find() returns a customer which contains your dict. No magic going on here. You are not reinventing too much by deciding to use lightweight wrappers and eschew automated SQL generation or ORMS and related DSLs.
Re: Object-Relational Mapping is the Vietnam of Computer Science
#14Earlier quoted context omitted.
There are lots of ways to do this. A most common approach is to have each of those dicts be a first class object in python/blub, and therefore you know the class of the object. Customer.find() returns a customer which contains your dict. No magic going on here. You are not reinventing too much by deciding to use lightweight wrappers and eschew automated SQL generation or ORMS and related DSLs.
You mentioned a "common approach". Is this the approach that you use or have you found a better way? The reason I ask is I don't quite understand how your description above correlates to an ORM type-mapping system. Customer.find() returns a customer which contains your dict. I don't know python but I assume a dict is a type-less hashmap. So if your customer has a field called 'updated_at', wouldn't you need to write…
Most client drivers/libs for RDBs have basic type conversions for each language. You don't always need an ORM for this. If you have a ruby or python Time object, the low level db lib generally will convert it to/from the RDB format.
I've used both simple and complex mapping methods. At the moment, I'm using mongodb with very simple first class object wrappers around the hash/dict. This is appropriate for this new app.
For an app I already have in production, I use postgresql and ruby's datamapper. This limits me to knowing that adding some features requires more work so those features keep getting pushed off the plate. The reason I use postgres for this app is because my users expect RDB ACID properties. For the new app I'm working on, not so much.
Re: Object-Relational Mapping is the Vietnam of Computer Science
#15The gist of the post is that there is a fundamental impedance mismatch between OO and Relational. If you try to apply inheritance to relational databases you get an unholy quagmire. My experience is that this is true. You get a rat's nest of tables and unwieldy joins.
There are more problems with schema ownership, dual schemas, and refactoring.
Coding Horror lifts the summary and leaves behind all the argument
Re: Object-Relational Mapping is the Vietnam of Computer Science
#16Earlier quoted context omitted.
The arguments in Atwood's and Neward's articles stand well on their own. The war analogy is there as link bait.
If anyone could be accused of linkbaiting it would be Neward since he wrote the original article titled "The Vietnam of Computer Science". But I think it's less useful to think of the war analogy as linkbait than as a didactic tool to bring attention to aspects of ORM use that Neward wished to highlight. Creating effective analogies is the same strategy used by good teachers the world over.
I had excellent engineering teachers. Never once did they compare the tough problems we were solving to Vietnam.
Re: Object-Relational Mapping is the Vietnam of Computer Science
#17Re: Object-Relational Mapping is the Vietnam of Computer Science
#18Earlier quoted context omitted.
You mentioned a "common approach". Is this the approach that you use or have you found a better way? The reason I ask is I don't quite understand how your description above correlates to an ORM type-mapping system. Customer.find() returns a customer which contains your dict. I don't know python but I assume a dict is a type-less hashmap. So if your customer has a field called 'updated_at', wouldn't you need to write…
Yes, dict is a hash map. A python dict is not "typeless", it contains whatever python objects you put in it. Most client drivers/libs for RDBs have basic type conversions for each language. You don't always need an ORM for this. If you have a ruby or python Time object, the low level db lib generally will convert it to/from the RDB format. I've used both simple and complex mapping methods. At the moment, I'm using mo…
Didn't know that. If that's correct, then the low-level db lib is an ORM in Python. In which case SQLObject/SQLAlchemy probably just harnesses those features and adds some additional cream on top.
Re: Object-Relational Mapping is the Vietnam of Computer Science
#19Earlier quoted context omitted.
If anyone could be accused of linkbaiting it would be Neward since he wrote the original article titled "The Vietnam of Computer Science". But I think it's less useful to think of the war analogy as linkbait than as a didactic tool to bring attention to aspects of ORM use that Neward wished to highlight. Creating effective analogies is the same strategy used by good teachers the world over.
The first thing wrong with this title is the article is about "software engineering", not "computer science". The second thing wrong is engineering is a discipline that teaches you about trade-offs, costs, and finding balance in your solutions. I had excellent engineering teachers. Never once did they compare the tough problems we were solving to Vietnam.
Re: Object-Relational Mapping is the Vietnam of Computer Science
#20Earlier quoted context omitted.
I think the comparison to Vietnam makes sense as an analogy . The basic argument seems to be that each ORM imposes limitations specific to that implementation which may result in the developer's choices being limited later on in the development process - just as early strategic decisions in a war can predetermine the outcome and potentially result in 'quagmire'. It's an argument that seems to echo Joel's idea of "lea…
The arguments in Atwood's and Neward's articles stand well on their own. The war analogy is there as link bait.