Re: retrieve rows in a specified order
Date: Mon, 22 Dec 2003 23:51:48 -0000
Message-ID: <MPG.1a5193f1a71043b2989861_at_news1.eircom.net>
dwolt_at_tincat-group.com says...
> > OK, so your first point is that adding a field is overly complex in some
> > way?
> My point is more that the model requires the user (developer) to specify
> what with other models would be unnecessary components -- both extra
> attributes and extra relations. This does tend to make for added complexity
> in my opinion.
> > Now I'm confused.
> > First you say that adding an Order_By_Field field to a db is too
> > complex, then you go on to propose what, to me, looks like a very
> > complex solution for what is a relatively simple task.
> My point is more that if you were to add data to an ordered list, the
> database would take care of the ordering field rather than a developer
> having to maintain it.
This is true enough, though in much the same way as adding an ordering field and never changing it would not require a developer to maintain it.
The man said in his posts, that this order has got to be able to be changed in different shops and/or at different times - this to my tiny brain implies somebody (shop manager usually) modifying some part of the data so that it appears on his web pages/app in the order that he wants - No?
> If one inserts into an array, the array handles the
> indexing (ordering) of the field behind the scenes. That seems natural and
> reasonable to me.
> I'm proposing using a conceptually simpler model than the
> relational model -- one that thinks more like a person thinks and speaks,
> including such constructs as functions that map to ordered lists within the
> model itself.
> > How is *_ANY_* system supposed to know how to order the products unless
> > you tell the system? AIUI, you are saying to do by "ordered
> > collections of foreign keys to the product database", whatever that
> > means!
> Sure, a user needs to insert before, after, between, or whatever, but no
> developer needs to tell the database how to handle that if the model
> implemented by the database understands ordered lists. Almost every
> database other than relational databases implements such a model.
But given any product that claims to be an RDBMS (Oracle, Sybase, <long list...>), there would be no need for the developer to tell the db how to handle anything - the results would arrive sorted by the manager decided order - the developer would just write an "ORDER BY" clause in his SQL - he wouldn't have to worry about the implementation of the db.
> By an ordered collection of foreign keys, this could be, for example, an
> array of product ID's. As an array, the product ids would be ordered. So,
> if you asked the database what was stored in the ProductsForWebCatalog field
> in the database, it might tell you
> CS394A
> NH283
> ANOTHERPRODUCTIDHERE
> If you asked for the ProductsAndPages, you could get
> CS384A 1
> NG283 1
> ANOTHER PRODUCTIDHERE 2
> to show that the first two products were being place, in that order on the
> first page of the web catalog and the last was on the second page.
This strikes me as being very dangerous in that the application developer has to know the browser settings of the user and/or what a HTML page is with respect to the data it is querying - this makes life very difficult IMHO.
> The
> end-user can use a GUI to click and drag products into whatever order they
> want
There is no reason why any half-competent programmer who uses SQL
couldn't allow his end-users to do the same.
> (this doesn't change the fact that the PRODUCTS file is not ordered)
We have already determined that in either system, the order in which the products come out in a select can be determined by the shop manager. You seem to be making dangerous assumptions about web page numbers which IMHO, the application developer shouldn't be concerned about - No?
> All of this information
> could be stored in the WEBPAGES file.
What is this WEBPAGES file?
> Again, this is not a relational
> database design unless using relation-valued attributes somehow, but it is
> possible in almost all non-RDBMS databases being used in production by
> companies today.
To me (in my naivity perhaps) it is very simple.
The database provides the data - it is up to the web server to format it - i.e. a section per product, - obviously you don't want to be sending hundreds of K over the internet - so you allow them to select all cars that are yellow and have a cc over 1.4l or whatever - the formatting of web pages is a different issue.
> > Somewhere in the system, an ordering is going to have to be stored.
> Yes, but the database can take care of that -- the developer need not have
> to.
Jesus! The developer is going to have to allow the user to change this
ordering criterion - he is going to have to provide some sort of
programmatical interface to the system to allow the manager to do this.
> > Can you expand on what you mean here exactly? What is normalising on the
> For data that is stored in something other than what was traditionally known
> as first normal form (that is, for data stored in systems that permit
> lists),
i.e. arrays?
Listen, I'm tired. I'll try and pursue your other points tomorrow, but I really think that you are very unclear in your thinking.
Paul...
-- plinehan y_a_h_o_o and d_o_t com C++ Builder 5 SP1, Interbase 6.0.1.6 IBX 5.04 W2K Pro Please do not top-post. "XML avoids the fundamental question of what we should do, by focusing entirely on how we should do it." quote from http://www.metatorial.comReceived on Tue Dec 23 2003 - 00:51:48 CET