Hi All,
I just upgraded to Dolphin 4.0, and chose the Standard Ed so I could get the Database support. I've over the docs on the Database classes, but at least at first read, this looks like just the basic 'talking to a SQL database' stuff, i.e. nothing different than what I would do if I were using C++ or Visual Basic or MS Access, etc. Not very Smalltalk-ish. No reason to use Smalltalk if that's all one needs to do. I was hoping someone could point me to some examples that go beyond the basic interfacing and into treating database rows or tuples as objects, and/or any other stuff that couldn't easily be done in any other language. Some motivation to do my next database project in Smalltalk. Lee Willis |
Hi,
The SQL databases ODBC connections are for relationa db enginesl. Therefore it should look like you were using it from any other language. However there is is database that is object oriented called Omnibase and designed for Smalltalk (built in Smalltalk) http://www.geocities.com/SiliconValley/Software/8887/omnibase.html They have an eval you can download, Costas Menico "Lee Willis" <[hidden email]> wrote: >Hi All, > >I just upgraded to Dolphin 4.0, and chose the Standard Ed so I could get the >Database support. > >I've over the docs on the Database classes, but at least at first read, this >looks like just the basic 'talking to a SQL database' stuff, i.e. nothing >different than what I would do if I were using C++ or Visual Basic or MS >Access, etc. Not very Smalltalk-ish. No reason to use Smalltalk if that's >all one needs to do. > >I was hoping someone could point me to some examples that go beyond the >basic interfacing and into treating database rows or tuples as objects, >and/or any other stuff that couldn't easily be done in any other language. >Some motivation to do my next database project in Smalltalk. > > Lee Willis > > > |
Hi Costas,
I'm not looking for an Object database, I'm interested in Smalltalks application to relational databases. I had read that there were advantages to using Smalltalk on relational databases. e.g. you can wrap a row of a table or query into a class, and then call methods on that class. I remember reading on one of the smalltalk groups that a large portion of professional smalltalk work is done in manipulating relational databases, but at the time I read it, I wasn't interested in rdbms, so I don't remember the details. I was hoping to learn more about this. Lee "Costas Menico" <[hidden email]> wrote in message news:[hidden email]... > Hi, > > The SQL databases ODBC connections are for relationa db enginesl. > Therefore it should look like you were using it from any other > language. However there is is database that is object oriented called > Omnibase and designed for Smalltalk (built in Smalltalk) > > http://www.geocities.com/SiliconValley/Software/8887/omnibase.html > > They have an eval you can download, > > Costas Menico > > "Lee Willis" <[hidden email]> wrote: > > >Hi All, > > > >I just upgraded to Dolphin 4.0, and chose the Standard Ed so I could get > >Database support. > > > >I've over the docs on the Database classes, but at least at first read, this > >looks like just the basic 'talking to a SQL database' stuff, i.e. nothing > >different than what I would do if I were using C++ or Visual Basic or MS > >Access, etc. Not very Smalltalk-ish. No reason to use Smalltalk if that's > >all one needs to do. > > > >I was hoping someone could point me to some examples that go beyond the > >basic interfacing and into treating database rows or tuples as objects, > >and/or any other stuff that couldn't easily be done in any other language. > >Some motivation to do my next database project in Smalltalk. > > > > Lee Willis > > > > > > > |
Lee, I think it is different from database access in other languages, but how
different it is depends on what you're trying to do. Using Dolphin's Database Connection puts ODBC into a Smalltalk idiom, but the technology behind the scenes can still be a limitation. For example, an object frequently consists of rows from multiple tables (orders, line items, customers, etc.). You have to handle the mapping of the proper rows from the proper tables to the objects you have in your system. In the simplest cases, of course, you can have a one-to-one mapping of a row to an object. As I recall, Dolphin handles messages sent to rows (instances of DBRow) via the Does Not Understand (DNU) mechanism. For example, to get a row from the Customer table: dbConn := DBConnection new open. "brings up a dialog allowing you to choose a datasource" dbStatement := dbConn exec: 'select * from customer'. "assuming you have a customer table, of course..." customerDBRow := dbStatement results first. customerDBRow name "assuming there is a 'name' column in the table" The problem with this approach is that (1) DNU isn't very direct, and (2) you have to use the actual column name (i.e., "CUST_NAME", if that's how it is in the table). I'm out of time now, but I hope this is at least enough to get you started. Don |
In reply to this post by Lee Willis
Lee,
I think that you are looking for an object-to-relational mapping framework, one that manages the converstion from objects to tables and rows. Unfortunately, Dolphin does not provide such a framework. In Cincom VisualWorks & IBM VisualAge, the third party TopLink product is the defacto standard. A public domain version called GLORP is only partially completed at the moment. In the pattern community, this general problem is ofter referred to as 'Crossing Chasms'. I hope this gives you some clues about what to look for .... In article <0oxZ5.21440$[hidden email]>, "Lee Willis" <[hidden email]> wrote: > Hi Costas, > > I'm not looking for an Object database, I'm interested in Smalltalks > application to relational databases. I had read that there were advantages > to using Smalltalk on relational databases. e.g. you can wrap a row of a > table or query into a class, and then call methods on that class. I > remember reading on one of the smalltalk groups that a large portion of > professional smalltalk work is done in manipulating relational databases, > but at the time I read it, I wasn't interested in rdbms, so I don't remember > the details. I was hoping to learn more about this. > > Lee -- Edward Stow [hidden email] Sent via Deja.com http://www.deja.com/ |
Free forum by Nabble | Edit this page |