Author Topic: Object Oriented Database  (Read 3118 times)

0 Members and 1 Guest are viewing this topic.

Troy Williams

  • Guest
Object Oriented Database
« on: August 09, 2005, 01:56:53 PM »
I was in the middle of playing with MySQL and normalizing tables when I said to myself, there has to be a better way. In the course of googling, I stumbled on this http://www.db4o.com/about/productinformation/. I tried it and and I think it is really neat. I just started to play around with this. So far, for the type of database work that I need, this fits the bill nicely.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Object Oriented Database
« Reply #1 on: August 09, 2005, 02:15:04 PM »
Thanks Troy , bookmarked ...
I've been playing with the MS SQL2005 Beta.
Seems pretty Good .. but it's my first foray into databases other than Access < does that count > , so ignorance may be bliss.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

Troy Williams

  • Guest
Object Oriented Database
« Reply #2 on: August 09, 2005, 02:21:30 PM »
Quote from: Kerry Brown
I've been playing with the MS SQL2005 Beta.


That's what started me into this adventure. I tried to install SQL 2005 Beta, but it would not allow me to install - it said I had an out of date .Net framework. Apperently the framework that ships with VB 2005 Beta is not good enough. The solution that I found to install SQL 2005 was to uninstall all of my .Net stuff (vb 2005, vb 2003, etc...) then install SQL 2005 first and everything after that.

Well that seemed like a lot of work. To make a long story short I download MySQL instead (it really is very nice and there is a site http://www.vbmysql.com/ that has a number if really good tutorials on using VB.net and MySQL, it even tells you how to install MySQL).

Kerry, you should give db4o a try. It'll be easier for you since you as there documentation is in C#.

Troy Williams

  • Guest
Object Oriented Database
« Reply #3 on: August 09, 2005, 02:29:41 PM »
Here is a small little teaser:

Code: [Select]

        Try
            myDB = Db4o.openFile(Application.StartupPath & "\" & DB_NAME) 'open the database - if it doesn't exist create it.
            myDB.set(_cars) 'Store the object
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        Finally
            myDB.close() 'clost the database
        End Try


There is a little bit more, but not much. You don't need to define anything in the database at all! You just pass it the object that you want to store. That's it.


Here is a query:
Code: [Select]

           
            Dim carColCounter As List(Of Car)
            Dim protoCarCol As New List(Of Car) 'this is the type of object that we want to find
            Dim result As ObjectSet = myDB.get(protoCarCol) 'store the results of the query in result

           writeLine(result.size() & " Car Collections found...") 'routine to output the number of car collection objects found.

            While result.hasNext
                carColCounter = DirectCast(result.next, List(Of Car)) 'cast each of the results into a car collection
                For Each carCounter In carColCounter 'print out the proper information
                    writeLine(carCounter.ToString)
                Next
            End While


I haven't been this excited since I downloaded and tried VB 2005 for the first time.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Object Oriented Database
« Reply #4 on: August 11, 2005, 07:42:44 PM »
That looks like an interesting library Troy.
Though you are correct about my preference, I dont like the idea of typing Dim a coupla hundred times a day.

Heh, I just noticed where you work. That would be a blast !!
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--