Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Data objects

Name: Anonymous 2006-06-20 3:47

So, what's so great about them? I want a good reason to care for them. As far as I could see, they are an OO maniac approach to make everything OO, but I weren't given a reason why this is better than writing the SQL directly (assuming you dont' care about database compatibility) and handling lists with the results.

In particular, data objects provide a good database abstraction layer, but my main concern with them is how are you going to do that huge complex select with three JOINs and WHERE, GROUP BY and HAVING. I get the feeling you can't do complex queries with them, and whatever SQL the system generates won't be as efficient as your hand-crafted, equally as productive one; and you can't benefit from database functions like IF or GROUPCONCAT.

So I want to know if data objects have a good thing to them which I should care for, or if they are just more OO enterprise wankery for certificated losers who think SQL is hard to write.

Name: Anonymous 2006-06-20 3:47

>>1
I meant GROUP_CONCAT

Name: Anonymous 2006-06-20 4:58

You're right; if you need to optimize a large query you're going to have to get your hands dirty and write some SQL. However that doesn't mean you should be hand coding SQL for everything. Let the language handle the day to day chores, your time is too valuable.

Name: Anonymous 2006-06-20 5:26

>>3
The hilarity is the OO mappers tend to waste even more time reinventing SQL

Name: Anonymous 2006-06-20 5:34

>>4
TBH I haven't used any other than Ruby on Rails, so I can't compare, but I found that RoR Just Works (TM) with basically no code.

I did take a quick look at Zope and wasn't impressed. It looked horribly overengineered; it even reinvents Java-style Interfaces! I'd hoped to escape those forever!

I've heard that PHP's DB interface sucks so much that PHP programmers prefer to build SQL queries by hand for everything.

Name: Anonymous 2006-06-20 6:08

>>5
I'm a Python guy, and Zope didn't look good to me either. I haven't used Python for web apps yet, but if I do, chances are that it won't be using Zope.

As for PHP's DB interface, not exactly. The DB extensions don't provide an abstraction, so not only you have to write queries by hand, but you'd have to use different functions for each DB. This is why you use a DB abstraction layer, and there are many good ones. I don't know how's Pear::DB, and there's PHP Data Objects which, as discussed in this thread, might not be worth it over writing queries yourself, but I know ADODB Lite and it's simple and productive if you like to query by hand.

Name: Anonymous 2006-06-20 7:41

I'm someone who has used Zope3 in a professional capacity. It's pretty ugly, in my opinion. The enterprisey types love it, but I think it's just a world of unpleasantness; a few good ideas drenched in shit and fail.

Name: Anonymous 2009-01-14 4:34

OOP reifies useless construct which fail to model real data.

Name: Anonymous 2010-06-07 6:51

Hi, I can spam /prog/ too, you faggot.

Also, smoke weed everyday.

Name: ​​​​​​​​​​ 2010-09-09 22:39

Name: Anonymous 2010-12-09 13:25

Name: Sgt.Kabu䟻kiman䥼ퟻ 2012-05-28 19:13

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List