From: John B. <jb...@dr...> - 2003-11-11 10:20:54
|
On Tue, Nov 11, 2003 at 10:04:56AM +0000, Andy Todd wrote: > John Baker wrote: > <rant> > I'm not. I'm writing an application which stores its data in a > relational database but which is written in an object oriented style. If > I wanted an object persistence mechanism I'd use something like ZODB or > PyPerSyst. > > This is something that irks me when working with colleagues who have > limited exposure to technologies other than, for instance, Java. They > are always in conflict with their DBAs (who do still exist btw) > justifying data models where one side is simply using the db as a > persistence mechanism and the other is trying to use the database > 'properly'. > > In general, the right solution is somewhere in the middle. Some of the > more esoteric object associations don't map nicely to databases and code > has to be written in your application to accomodate them. Likewise you > can't always have a third normal form relational model in your database, > sometimes you have to live with a little duplication or non-optimal > storage structures to make the application easier to code. Its all about > compromise > </rant> > > Sorry about that, but *I* feel better now. That's ok :-) DBAs are a dieing breed. After all, who needs a DBA for MySQL or Postgres? Alright, so you may be using Oracle, and I pity you :) If SQLObject is to be aimed at a very limited set of solutions, that don't lend themselves towards proper OO programming, then perhaps clearly stating this on the website would be a step forward. But at this point in time, without superset mapping, you cannot model anything more than trivial relationships. This makes it rather unhelpful, which is a shame because it's actually quite easy to use. Databases are there to store data. They should do no more. I do not subscribe to the Oracle approach of, "Let's throw lots of crap into a product [nat/firewall/multiple redo files]" in a desperate attempt to provide a reason for an upgrade. I've got a bunch of databases, some of which have tables that are a mere 500megs, mapped using superset mappings. I see no performance issues, although I am using MySQL :) To the developer, how the data is stored is totally irrelevant. But when your developer can't actually model relationships because the system of persistence is restrictive, then we have a problem. I've already provided two or three examples that clearly demonstrates that SQLObject can't do what I want it to do, and I'm hardly trying :-) It's not my project, and superset mappings would be tricky to implement. But as it is, assuming you can't have this type of mapping, the foundations of the project are extremely limited. And as we all, as good OO developers know, if you build on poor foundations, you regret it later in life. John |