Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38272 > unrolled thread

Thoughts on SQL vs ORM

Started byAndriy Kornatskyy <andriy.kornatskyy@live.com>
First post2013-02-06 15:58 +0300
Last post2013-02-06 20:03 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Thoughts on SQL vs ORM Andriy Kornatskyy <andriy.kornatskyy@live.com> - 2013-02-06 15:58 +0300
    Re: Thoughts on SQL vs ORM rusi <rustompmody@gmail.com> - 2013-02-06 10:03 -0800
      Re: Thoughts on SQL vs ORM Walter Hurry <walterhurry@lavabit.com> - 2013-02-06 20:03 +0000

#38272 — Thoughts on SQL vs ORM

FromAndriy Kornatskyy <andriy.kornatskyy@live.com>
Date2013-02-06 15:58 +0300
SubjectThoughts on SQL vs ORM
Message-ID<mailman.1408.1360155567.2939.python-list@python.org>
The question of persistence implementation arise often. I found repository pattern very valuable due to separation of concerns, mediate between domain model and data source (mock, file, database, web service, etc).

The database data source is somewhat specific since you can proceed with SQL functions or ORM. Here are some thoughts why you might prefer SQL functions over ORM in your next project:

http://mindref.blogspot.com/2013/02/sql-vs-orm.html

Comments or suggestions are welcome.

Thanks.

Andriy Kornatskyy 		 	   		  

[toc] | [next] | [standalone]


#38299

Fromrusi <rustompmody@gmail.com>
Date2013-02-06 10:03 -0800
Message-ID<bda93f4d-c27b-43a7-bfdc-3fbd77e41f56@u21g2000vbo.googlegroups.com>
In reply to#38272
On Feb 6, 5:58 pm, Andriy Kornatskyy <andriy.kornats...@live.com>
wrote:
> The question of persistence implementation arise often. I found repository pattern very valuable due to separation of concerns, mediate between domain model and data source (mock, file, database, web service, etc).
>
> The database data source is somewhat specific since you can proceed with SQL functions or ORM. Here are some thoughts why you might prefer SQL functions over ORM in your next project:
>
> http://mindref.blogspot.com/2013/02/sql-vs-orm.html
>
> Comments or suggestions are welcome.
>
> Thanks.
>
> Andriy Kornatskyy

Interesting read. Your first 2 points:
1. It is not valid to think that relational model in database is
domain model of application. They are different (except some trivial
cases).
2. … Design your domain model with plain objects only

And then later you go on to recommend SQL over ORM. So its not clear
which side you are on!

My own very preliminary thoughts on this:
SQL is basically a functional language.
OOP is just imperative programming with some syntactic sugar, name-
spacing etc.
IOW OOP is a lower level paradigm than FP because it deals with the
'how' more than the 'what.'

Object-relational impedance mismatch happens because of the opposite
reason to what people seem to believe: Because the higher-level SQL is
pulled down into the lower-level OO mindset and not the other way
around

[toc] | [prev] | [next] | [standalone]


#38301

FromWalter Hurry <walterhurry@lavabit.com>
Date2013-02-06 20:03 +0000
Message-ID<keucur$qld$2@news.albasani.net>
In reply to#38299
On Wed, 06 Feb 2013 10:03:08 -0800, rusi wrote:

> On Feb 6, 5:58 pm, Andriy Kornatskyy <andriy.kornats...@live.com> wrote:
>> The question of persistence implementation arise often. I found
>> repository pattern very valuable due to separation of concerns, mediate
>> between domain model and data source (mock, file, database, web
>> service, etc).
>>
>> The database data source is somewhat specific since you can proceed
>> with SQL functions or ORM. Here are some thoughts why you might prefer
>> SQL functions over ORM in your next project:
>>
>> http://mindref.blogspot.com/2013/02/sql-vs-orm.html
>>
>> Comments or suggestions are welcome.
>>
>> Thanks.
>>
>> Andriy Kornatskyy
> 
> Interesting read. Your first 2 points:
> 1. It is not valid to think that relational model in database is domain
> model of application. They are different (except some trivial cases).
> 2. … Design your domain model with plain objects only
> 
> And then later you go on to recommend SQL over ORM. So its not clear
> which side you are on!
> 
> My own very preliminary thoughts on this:
> SQL is basically a functional language.
> OOP is just imperative programming with some syntactic sugar, name-
> spacing etc.
> IOW OOP is a lower level paradigm than FP because it deals with the
> 'how' more than the 'what.'
> 
> Object-relational impedance mismatch happens because of the opposite
> reason to what people seem to believe: Because the higher-level SQL is
> pulled down into the lower-level OO mindset and not the other way around

I'm afraid I don't understand what all that means.

But I invariably go for SQL over any abstraction paradigm.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web