I do not think the ORMs are better at something functionally. They are
syntactic sugar.

It boils down to whether a Table is a class (ORM) or an instance (DAL)
and a row is an instance of the table class (ORM) or an instance of a
record class (DAL).

If a row is an instance of a table class, then you need to treat the
result of a join or an aggregate as an exemption. That is why web2py
was developed 4 years after Django but had support for left joins and
aggregates 2 years before Django did. And we are still better at them.

Django has better support for certain types of many2many because with
the object model that an swipe more code under the rug (magic) we I do
not like to do when accessing a database.

The Django developers have mastered metaclasses but not operator
overloading.

Anyway, you can use some Django and some SQLALchemy syntax in web2py:
http://www.web2py.com/AlterEgo/default/show/189

Massimo

On Jan 26, 12:19 pm, VP <[email protected]> wrote:
> To be fair, the most popular option right now is SQLAlchemy, an ORM.
> DAL appears to be a minority approach.  So, ORM must be good at
> something right?
>
> To get web2py out of the PR's ditch, I think it's best to refrain from
> commenting on perceived weaknesses of Django and other technologies.
>
> On Jan 26, 11:08 am, blackthorne <[email protected]> wrote:
>
>
>
>
>
>
>
> > few people mention this, don't know why but it is huge.
> > ORM's are a computational vietnam.
>
> > it troubles my mind, how come so many good programmers don't have this
> > notion and ORM's are actually very well seen.
> > the relational model has its own way of working, its mindset, its
> > optimizations. the object model works in a different way, its
> > implementations have an higher sofistication for each data unit that
> > knows all about itself and considers less fast searches as you can do
> > with relational databases and its simpler way of storing things
> > allows.
>
> > the result of using an ORM is having a complex translation process
> > from objects to SQL, then you get a second major loss because the
> > generated is very bad, very generic, not specific. then, you a third
> > major loss when you have to translate the resulset from SQL to objects
> > again.
>
> > many times, reality is much worse. if you make things like
> > dog.getName() == cat.getName() the ORM will make
> > select * from dog
> > select * from cat
> > put everything in memory and then make the search in memory. having an
> > extremely optimizes relational database is probably worst than having
> > simple files with pickles, really..
>
> > bottom line, you want to store objects and make queries over them, use
> > object oriented databases. they exist, not by chance.. you have db4o
> > in Java, ZODB in python.
> > else if you want relational databases, use their language SQL or the
> > smallest abstraction possible.
>
> > On Jan 26, 3:50 pm, Martín Mulone <[email protected]> wrote:
>
> > > 2011/1/26 Massimo Di Pierro <[email protected]>
>
> > > The DAL tries to be as close as possible to SQL. The ORM
>
> > > > tries to stay as close possible to an Object model. To me that is
> > > > trying to put a circle into a square. When it fits great, some times
> > > > it does not fit.
>
> > > > Massimo
>
> > > Quote of the day!.
>
> > > --
> > > Pablo Martín Mulone ([email protected])http://www.tecnodoc.com.ar/
> > > Paraná, Entre Ríos, Argentina (CP 3100).
>
> > > My blog:http://martin.tecnodoc.com.ar
> > > Expert4Solution 
> > > Profile:http://www.experts4solutions.com/e4s/default/expert/6

Reply via email to