Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Absurd OO Design Practice: Query Classes

Reply
Thread Tools

Absurd OO Design Practice: Query Classes

 
 
faceman28208@yahoo.com
Guest
Posts: n/a
 
      07-26-2006
Over the past few years I have consulted on six large projects that all
independently arrived at the same moronic design desision: The use of
SQL query classes.

No, I don't mean a class hierararchy like:
SQL Query
UpdateQuery
SelectQuery
Where you hide the details of the underlying database API. (Along the
lines of what Rogue Wave does.)

I mean a system where there is a sepate and distinct class used for
every query in the system. [What next, have employee virtual classes
from which you derive a separate class for each employee?????]

All of these have systems employed home-brew code generators. You give
it a query and it generates a class with a bunch of set and get
members. None of these code generators were very sophisticated (e.g.
all used hand coded recursive-descent parsers). They varied in their
levels of capability. One of them could support joins but it took great
effort. Another supported joins but only inner joins. One was database
independent. The others were not.

The obvious theoretical problem from such an approach is the number of
possible queries is potentially [nearly] infinite. Thus, the number of
potential classes in the system is nearly infinite.

The obvious practical problems resulting from this approach included:
1. On all of these systems, most of the code was query classes. One
system had so many of them that it took two days to rebuild the
systems.
2. Each time the system needed a query, the developer either had to
concocted a new query class from the code generator or (even worse -
but more likely) they would piece together existing query classes to
get what they needed. Instead of one query with joins, you have nested
queries in the appllication. In investigating a performance problem in
one of these systems, it turned out the application was executing
400,000 queries where one would have sufficed. In several cases I found
code that walked through and counted rows in select queries rather than
doing "Count(*)".

Of course the "architects" for all of these systems were long gone
before the problems showed up.

So here's my question: Is there some source (book, magazine, etc.)
advocating such an approach to databases? It would strike me as an
unusual coincidence for so many projects at different companies to
independently arrive at the same stupid idea (and suffer the same
brutal consequences).

 
Reply With Quote
 
 
 
 
Howard
Guest
Posts: n/a
 
      07-26-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Over the past few years I have consulted on six large projects that all
> independently arrived at the same moronic design desision: The use of
> SQL query classes.


<snip>

And your C++ language question is...?


 
Reply With Quote
 
 
 
 
faceman28208@yahoo.com
Guest
Posts: n/a
 
      07-26-2006

Howard wrote:
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ups.com...
> > Over the past few years I have consulted on six large projects that all
> > independently arrived at the same moronic design desision: The use of
> > SQL query classes.

>
> <snip>
>


Pardon me, I just thought I heard a fart in the wind.

 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      07-26-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:


> Pardon me, I just thought I heard a fart in the wind.



*plonk*




Brian
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Frustration over absurd and pointless browser version checking Jamie Kahn Genet NZ Computing 27 01-31-2007 06:07 PM
Patently absurd Peter NZ Computing 9 07-27-2005 02:46 PM
Order time for x64 is absurd... Billie Volkova Windows 64bit 12 07-01-2005 04:08 PM
Is there a person who I experience absurd event that experience? PS2 gamer Cisco 4 06-01-2004 07:52 PM
Absurd fonts... :( ::spidernik:: Firefox 1 11-24-2003 06:29 PM



Advertisments