![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
In case you had any doubts what would be a SQL solution here you have it: CREATE TABLE Users ( user_id INTEGER NOT NULL PRIMARY KEY, username VARCHAR NOT NULL, CONSTRAINT groups_uq UNIQUE (username)); CREATE TABLE Groups (group_id INTEGER NOT NULL PRIMARY KEY, group_name VARCHAR , CONSTRAINT groups_uq UNIQUE (group_name)); CREATE TABLE r_users_groups ( user_id INTEGER NOT NULL , group_id INTEGER NOT NULL, CONSTRAINT r_users_groups_pk PRIMARY KEY (user_id, group_id), CONSTRAINT r_users_groups_fk1 FOREIGN KEY (user_id) REFERENCES users ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT r_users_groups_fk2 FOREIGN KEY (group_id) REFERENCES groups ON DELETE CASCADE ON UPDATE CASCADE ) CREATE INDEX r_user_groups_idx1 ON r_user_groups (group_id); |
#2
| |||||||||
| |||||||||
|
|
After a long history of trolling on comp.databases.theory and comp.databases.object this is by far the worst bullshit you can spin in one post. |
|
Whenever I want to do any of the operation memntioned in the challenge it takes me exactly 1 SQL statement. To "bind it" in Java, I'd only have to something like MyApp.dbConnection.execute( statement ) |
|
- You need to load objects from SQL. Not really. |
|
http://groups.google.com/groups?as_u...) t-online.com |
|
http://groups.google.com/groups?as_u...) t-online.com |
|
http://groups.google.com/groups?as_u...) t-online.com |
|
http://groups.google.com/groups?as_u...) t-online.com |
|
I am sure, there are about 20 more points. I bet Scott Ambler has listed them somewhere in his papers. I am not an expert at O-R mapping since I think it's a pain. That's all very much BS. Scott Ambler doesn't have a clue what a relational database is, and apparently you don't have any clue also. |
|
If you want to know what a DBMS is, you should definitely read Chris Date. |
#3
| |||
| |||
|
|
Costin Cozianu wrote: After a long history of trolling on comp.databases.theory and comp.databases.object this is by far the worst bullshit you can spin in one post. Personal insults are not my level of discussion so I guess we can end the thread at this point. Whenever I want to do any of the operation memntioned in the challenge it takes me exactly 1 SQL statement. To "bind it" in Java, I'd only have to something like MyApp.dbConnection.execute( statement ) With this approach you are not programming OO. You are only using Java as your shell for SQL. |
|
The relational SQL approach tries to "look at all data at the same time from the top with one statement". Object orientation works the other way around: "Look at the smallest representations and try to solve small problems, one at a time." |
#4
| |||
| |||
|
|
In case you had any doubts what would be a SQL solution here you have it: CREATE TABLE Users ( user_id INTEGER NOT NULL PRIMARY KEY, username VARCHAR NOT NULL, CONSTRAINT groups_uq UNIQUE (username)); CREATE TABLE Groups (group_id INTEGER NOT NULL PRIMARY KEY, group_name VARCHAR , CONSTRAINT groups_uq UNIQUE (group_name)); |
#5
| |||
| |||
|
|
Costin Cozianu <c_cozianu (AT) hotmail (DOT) com> wrote Costin, In case you had any doubts what would be a SQL solution here you have it: CREATE TABLE Users ( user_id INTEGER NOT NULL PRIMARY KEY, username VARCHAR NOT NULL, CONSTRAINT groups_uq UNIQUE (username)); CREATE TABLE Groups (group_id INTEGER NOT NULL PRIMARY KEY, group_name VARCHAR , CONSTRAINT groups_uq UNIQUE (group_name)); The model could be even more simple because the user_id and group_id are not necessary. IMO they only introduce unnecessary complexity to the logical database design. Alfredo |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Therefore db4o, FastObjects many and other OODBs can only be used by applications and not on the command line. That means we always have to write a small OO-Application (java, c++,...), no matter how small the problem is. |
#8
| |||||
| |||||
|
|
On Tue, 24 Jun 2003 07:55:57 -0700, Costin Cozianu c_cozianu (AT) hotmail (DOT) com> wrote: But as Carl said, in your example an OODBMS cannot win (and will not loose) because there is nothing OO specific. Well, they loose if they make simple problems difficult. Not that RDBMSes are winners, they're loosers too in other areas. Just different kinds of loosers.Which looses worse is a matter of context, and very fine level of details. There seems to be a general misunderstanding about the concepts of oo-databases: Java or C++ Objects only exist in the context of an oo-application. |
|
Therefore db4o, FastObjects many and other OODBs can only be used by applications and not on the command line. That means we always have to write a small OO-Application (java, c++,...), no matter how small the problem is. |
|
Basically the only thing one can say is writing an oo program for your user/group example is more effort than writing some SQL statements. So if you are happy with some shell scripts wrapping the SQL statements: fine! |
|
However Carl's argument that object databases save orders of magnitudes in development time is dishonest. They might be doing that for some problems, but not in general. I fully agree with Carls statement as long as we are talking about oo-applications and persistency support. Maybe he should have made that point clearer. |
|
Kind Regards, Bernd Deichmann, Poet Software |
#9
| |||||
| |||||
|
|
Hi Bernd, I appreciate your arguments in favor of OO databases, however I smell quite a Red Herring, somehow. hmmm. lets see. Bernd Deichmann wrote: On Tue, 24 Jun 2003 07:55:57 -0700, Costin Cozianu c_cozianu (AT) hotmail (DOT) com> wrote: But as Carl said, in your example an OODBMS cannot win (and will not loose) because there is nothing OO specific. Well, they loose if they make simple problems difficult. Not that RDBMSes are winners, they're loosers too in other areas. Just different kinds of loosers.Which looses worse is a matter of context, and very fine level of details. There seems to be a general misunderstanding about the concepts of oo-databases: Java or C++ Objects only exist in the context of an oo-application. Or a specific language as in some specific databases ? Or a handful of languages ? Sure, I use some kind of persistence for a specific area of my current project, and is *not* a relational databases. It's just that I don't automatically equate data management with object persistence. When to use one versus the other is subject of occasional troll fests. |
|
Therefore db4o, FastObjects many and other OODBs can only be used by applications and not on the command line. That means we always have to write a small OO-Application (java, c++,...), no matter how small the problem is. That's fine with me. But do I have to write many lines of code for simple problem ? Or can I just write one statement, snap some query component , and some display component like I can do in VB or DelPhi ? Basically the only thing one can say is writing an oo program for your user/group example is more effort than writing some SQL statements. So if you are happy with some shell scripts wrapping the SQL statements: fine! That's a big Red Herring. I don't have to be happy writing only shell scripts. I can be happy writing OO applications, shell scripts, Delphi component based applications, Crystal Reports -- guess what -- reports, Excel spreadsheets, run advanced statistic packages. |
|
Before you jump in and claim that Delphi style of application doesn't scale, is not OO, and all the others , here are some hard fighures - 1 man (me) - full blown accounting system for a non-trivial system (roguhly tens of millions of dollars), multi-user, OLTP, reports, the whole enchilada - Delphi, PostgreSql, Excel are the main ingredients . 3 months development time, including production roll-out. Still in use unmodified after 3 years. Speeds like one screen/associated transaction per hour or one report per hour are not uncommon. You can't really do the same with object models. |
|
All that it boils down to in the end is the eternal LOC. It has been observed repeatedly that the capacity of 1 developer to produce/assimilate/debug/maintain 1 LOC is roughly the same regardless of paradigm/programming language (of course, not talking about extremes). However Carl's argument that object databases save orders of magnitudes in development time is dishonest. They might be doing that for some problems, but not in general. I fully agree with Carls statement as long as we are talking about oo-applications and persistency support. Maybe he should have made that point clearer. That's one big single mistake of OODB vendors. I'm a user, programmer, architect, leader and what have you. |
|
I don't think automatically in terms of "objects" and "persistency support". I think in terms of problems and solutions. Some information I might package as objects, other I might look at it as tuples, some areas are programmed OO, other functionally. Whatever gives me just a few lines of code and good performance. It's not always objects. Completely agree. |
#10
| |||
| |||
|
|
"Bernd Deichmann" <bernd.deichmann (AT) poet (DOT) de> wrote in message news:rcogfvko7tke858j4bkph8lhd2odrud589 (AT) 4ax (DOT) com... Hi Costin, your challange proves absolutely nothing. Whether a OODB or a RDBMS or whatever is the best solution for a given task depends among others on the question how you _want_ to model your data/classes. A lot of people think that oo-modeling is a good idea, I agree with them. Carl already argued that your model is very trivial and does not show the advantages of oo-modeling, but that is not the point: A OODB is an appropriate solution if you have objects that you want to store. Looking at your challange we could now discuss whether oo-modelling makes sense or not, but I am absolutely not interested in that point. In other words, you accept on faith that OODB is the appropriate solution and you are not open-minded to other suggestions. |
| The real-world szenarios for OO-databases start from a completely different point: Somebody decides to write an application and to use oo-techniques. The real-world scenario for database management starts from observing that data must serve the needs of multiple applications. |
| OODBs are made to support oo applications, not command line tools. That's a rather pointless statment. An rdbms is made to support all applications. But the are not the best solution in all areas. Can you agree? |
![]() |
| Thread Tools | |
| Display Modes | |
| |