473,809 Members | 2,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Absurd OO Design Practice: Query Classes

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).

Jul 26 '06 #1
3 1536

<fa**********@y ahoo.comwrote in message
news:11******** *************@s 13g2000cwa.goog legroups.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...?
Jul 26 '06 #2

Howard wrote:
<fa**********@y ahoo.comwrote in message
news:11******** *************@s 13g2000cwa.goog legroups.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.

Jul 26 '06 #3
fa**********@ya hoo.com wrote:

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

*plonk*


Brian
Jul 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1220
by: Roger Leigh | last post by:
I'm developing a library to allow interaction with an SQL database. Rows in the database are represented with by a user-defined row class with the following inheritance hierarchy: SigC::Object libsigc++ object (allows calling of class ^ methods by slots in response to signals) | libpqxxobject::row_base common row state (whether modified, and ^ if initialised etc.) + signal emission |
2
2024
by: Calvin | last post by:
I'm fairly new to programming, that said, I know how to 'program', but my question is about design. How big and what sort of objects should be stored in Session. I'm doing an e-commerce website, and I've created an xsd based around the shopping cart, customers details and the order's tables. The resulting dataset is then populated accordingly and stored in session. Is this bad news? I ask because the articles I read suggest limiting...
3
1885
by: Crirus | last post by:
Hello again I have this issue. I need to design a game weapon. I made a base class Weapon Each weapon have: - range(max 1-16), - ToHit array of values that gives percent that should be returned by a random in order to apply damage to enemy -Power ... the damage to apply to a hitted target
5
4106
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each table in design mode and then add the new field and set its properties. Thanks. --
2
1545
by: Simon Woods | last post by:
Hi I'm just working through (and learning) the standard GoF Design Pattern and the example of the Bridge pattern on http://www.dofactory.com/Patterns/PatternBridge.aspx#_self2 I notice at the heart of the real world example is an abstract class MustInherit Class DataObject Public MustOverride Sub NextRecord()
1
1569
by: dbarmer | last post by:
I have a unix database system that hold three tables, 254, 255, 256, and all are linked together by WO, CUST NO, LOC NO. This is for Unix Program Purposes Only. Duplication here is by design. So Up Front I have duplicated data due to a sequence work'd performed. For example. WO 000001 has duplicate WO, CUST, LOC etc... four times because it has four different Work Descriptions. SO, When I transfer these tables to access and create a...
4
1401
by: andrew.smith.cpp | last post by:
Whts the Design pattern of the Classes?
1
1532
by: alipark | last post by:
hi, I am fairly newb to mysql, so excuse my silly question. I am working on a vbmysql application for a warehouse. Here I am importing an excel sheet to mysql which has weekly status of the products. I am storing it in the same table with date and product code and qty. I want to display the weekly report and monthly report. Monthly report is easy but the problem is getting distinct values of rows as different columns for weekly report. i.e. I...
1
2339
by: rsmlmlb | last post by:
I need to create a query from 3 tables (client, work and accts recv). The client table has the unique id. The work table has wrkdte and the accounts receiveable has ardte. How can I pull the work within a certain time period along with payments within the same time period?
0
9601
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10379
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7660
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.