Re: [Dbixx-devel] Questions about DatabaseInterface
Status: Alpha
Brought to you by:
cyborch
From: Anders B. <an...@we...> - 2002-06-07 14:35:58
|
Jerry Seutter wrote: > Hello Anders (and others), > > I have been taking a look at the code to see how it is supposed to work. > > You mention on the homepage and the emails that the PersistentFactory > should call DatabaseInterface's load() method to get the object from the > database. Everything was making sense until I looked for a class that > implements DatabaseInterface. The only one that implements it is > SybaseInterface. I am trying to use MySQL. > > There is a class dbixx.sql.mysql.MySQLInterface that extends > SQLDatabaseInterface but does not implement DatabaseInterface. > > My question is, should dbixx.sql.mysql.MySQLInterface implement > DatabaseInterface or should there be a class dbixx.MySQLInterface, similar > to SybaseInterface, that implements DatabaseInterface? > > You mentioned in a previous mail that SybaseInterface needs to be > rewritten. > > Looking at dbixx.sql.mysql.MySQLInterface, it looks like it is meant to > handle the connection to the database and construct the query that returns > the attributes. > > My guess is that there needs to be a dbixx.MySQLInterface that implements > DatabaseInterface and uses an instance of dbixx.sql.mysql.MySQLInterface. > Is this correct? > > As you can probably tell, my understanding is limited, but I'm trying to > figure this out. Feel free to correct/flame me. > > As an aside, one of the diagrams on the homepage has text so small that it > is unreadable. Could you replace it with a larger version? > > Jerry Seutter > The classes in the dbixx.sql package are only SQL abstractions, the classes in the dbixx package contains what the library is really all about. You are absolutely correct that only dbixx.SybaseInterface implements the dbixx.DatabaseInterface interface. We will need a dbixx.MySQLInterface which uses the dbixx.sql classes (and their methods). To answer your question: No, dbixx.sql.mysql.MySQLInterface should NOT implement dbixx.DatabaseInterface, but a dbixx.MySQLInterface class should be written which implements dbixx.DatabaseInterface in much the same way as dbixx.SybaseInterface implements dbixx.DatabaseInterface. So in short: You are correct in your guess. The dbixx.SybaseInterface.load method I described (in pseudocode) in my last mail could be implemented almost identically in a dbixx.MySQLInterface.load method. Please go ahead and write such a method! I must excuse the low activity (on my part) on the project during the last week. This will change shortly. I will implement a new version of the dbixx.SybaseInterface method which should work as a template for the dbixx.MySQLInterface class methods (which I strongly encourage you to implement). If you have any further questions (or if I didn't answer your original question) you are very welcome to write! On your side note: right I only resized the image via the img tag, go ahead and right-click on it to view it. I resized it to make the page more readable in general. I have changed the page to make the image a link to a full sized view of the image. I hope this helps. -- Anders Borch Web Forge Software Engineer Jenagade 22 G, 2300 Copenhagen S, Denmark an...@we... www.web-forge.dk |