Results 1 to 14 of 14
  1. #1
    Join Date
    Apr 2008
    Posts
    27

    OODB or RDB for checkbook/budget program?

    Hi,
    I wrote myself an Access db several years ago to do some things for my checkbook and budgeting and I've really enjoyed it ever since. Lately I've been thinking about writing it as a stand alone program so I could let my family and friends use too (I don't want it to be Access dependent because I don't want to have to troubleshoot and support it on different versions of Access or MDAC).
    Anyway, recently I took a class on OO programming logic and a C++ class, and as I was thinking of how to design it, I was thinking in terms of objects. For instance, a transaction would be an object with attributes like a date, amount, etc. But then I realized that designing it this way seems to be fundamentally different from the way I did it originally with Access. So it looks like the first big decision I have to make is to decide whether to use object oriented db design or relational db design. Is this true, and if yes, which way would be better to go for a checkbook/budgeting app?
    Thanks for your help.

  2. #2
    Join Date
    Dec 2007
    Location
    London, UK
    Posts
    741
    If not Access/Jet then what database platform do you intend to use? Another SQL one?

    Don't confuse application design with database design. There are well tried and tested principles for designing SQL/Relational databases. If you are using a SQL DBMS then I would advise you to base your database designs on data modeling techniques and knowledge of your DBMS rather than on what you know about OO programming.

  3. #3
    Join Date
    Apr 2008
    Posts
    27
    As you can tell I'm very new to this. There's a good possibility I am confusing application design with database design. I do understand db design a little, but I really don't know how/where it relates to application design.
    If it helps any (and this might not make total sense, or be relevant, since I really don't know a lot about what I'm talking about, so feel free to disregard it) I'm not married to the new program being RDB like the Access db I have now. If it's better to do OODB, ie with transactions being objects with attributes like dates and amounts, I'm open to that. Although, and maybe you can tell this already, I don't know how to do an OODB, ie is the data stored in flat files? I only know what little I learned in C++ class and the OO Programming Logic class and we didn't touch on databases at all.
    Last edited by CVD; 07-11-09 at 18:17.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    OOD (Object Oriented Design) and OODB (Object Oriented DataBase) are two completely different things.

    Your data (and therefore database) lives on no matter what, as long as the underlying problem that the database manages continues to exist. In other words, as long as you have a bank account, you'll want a database to help manage it. I've worked on many databases that started out as flat files on mainframe COBOL, migrated to mini computers, on to micro computers. The database lives on long after the platform(s) where it started are gone.

    OOP makes it easy to "wrap" the store/retrieve functionality within an object method. If necessary, you can actually make a high-level "controller" method with subsidiary methods for dealing with different storage systems (say one sub-method for SQL and another for dBase).

    The "short answer" is to create a database according to good relational design principles. Create an application or applications to use that database design. The app can be OO, web based, or whatnot because the application will eventually die but the database will live on as long as the problem does!

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  5. #5
    Join Date
    Apr 2008
    Posts
    27
    Thanks Pat.
    So I can have an RDB for my data and an OO front-end? (is "front-end" the correct term?)
    Would C++, Python, and Java work with any sql-based RDB data store? In other words are my choices wide open?

  6. #6
    Join Date
    Nov 2008
    Posts
    28
    I'm about as green and wet-behind-the-ears as they come as far as programming... but if you are thinking about recreating it as a stand-alone application I believe SQLite would probably work very well for your purposes.

    SQLite Home Page

    Alan Gauld (frequent contributer to the python-tutor mailing list) has a good web page here:

    Learning to program

    as an intro to programming with python, including some sample work with sqlite for a simple address book. Actually, I believe sqlite comes bundled with python as of v2.5, and as a part of php also. For C... I think there is a fair amount of documentation on how to access a sqlite database via whatever the appropriate program calls would be.


    HTH,

    Monte
    Last edited by memilanuk; 07-12-09 at 16:18.

  7. #7
    Join Date
    Apr 2008
    Posts
    27
    Thanks a lot Monte, I'll check it out.

  8. #8
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    The match between programming languages and data storage engines isn't completely wide open, but it is close enough that I've never had to think about it. C++ can access almost any storage engine, I can't think of any store that C++ can't access. Python is a bit more problematic, but it can access most data stores. Java has very little native access to data stores due to the design of the "java machine", but it has libraries that will allow you to access most if not all data stores.

    The short answer is that you don't have a completely "parts is parts" access to storage from every programming language, but its close enough to that it shouldn't be a problem.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  9. #9
    Join Date
    Apr 2008
    Posts
    27
    Thanks. If I've decided on SQLite or SQL Express for the back-end, do C++, Java, or Python have advantages or disadvantages compared to each other regarding the db?

  10. #10
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    As long as they all connect to the database of choice, I'd pick the language based on the task at hand (your checkbook in this case). If you have even minimal connectivity to the database, you can easily code around any issues. Use the language that best suits your problem.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  11. #11
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    nah
    you can use what ever data storage mechanism you want
    you can use whatever front end you want
    The choice of either is often dictated by things like cost, availability experinece, familairity whether the app is to be used by third parties and so on.

    the choice of front end should be whatever you feel most familiar with traded off against cost and usability.

    I don't think there is any significant advantage in using Python, C++, Java, C#, VB, Delphi, PHP PERL or whatever. if you a more familar with C++ then I'd probably use C++, like wise Java or Python. If you are starting from scratch (ie simialr experience on all 3 then I'd probably chose java, then C++ then Python).

    all 3 languages should be able to talk to any data store you select. as an earlier poster has said SQL lite works with Python.

    however I have a sneaking suspicion that using a realtional DB is overkill for thius app... you could probably do just as good a job for the user by using flat files (suitably encrypted so the user cannot tinker with the data within).

    in fact if you want to make this a trainign app you could sub class the data storage mechanism so that depending on installation the app talks to whatever back end storage mechanism the user has chose to use, and you have chosen to support. so if the app was installed on a DBA's compouter who may have access to MySQL, SQL Server it coudl talk to there, if it was a Microsoft PC say to SQL lite or JET, if it was an Apple filemaker or whatever
    I'd rather be riding on the Tiger 800 or the Norton

  12. #12
    Join Date
    Apr 2008
    Posts
    27
    The concept of sub classing the data storage is interesting. I didn't know that could be done. I'll remember that.

    One question though. What makes you lean toward Java over C++ or Python? I have taken an OO Logic class and a C++ class but have very little experience, so I'm at about the same level with each of them, I'd say.

  13. #13
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Quote Originally Posted by CVD
    The concept of sub classing the data storage is interesting. I didn't know that could be done. I'll remember that.
    See post #4 above.
    Quote Originally Posted by CVD
    One question though. What makes you lean toward Java over C++ or Python? I have taken an OO Logic class and a C++ class but have very little experience, so I'm at about the same level with each of them, I'd say.
    Java has a theoretical advantage of "write once, run anywhere" that I've never seen pan out... It seems that every version of Java is incompatible with all other versions in some important way. Java coding is a highly marketable skill, which makes it worth learning.

    C++ has the advantage of being at least as ubiquitous as Java, in that every Operating System / machine that I've ever seen has a C++ compiler, and many have cross-compilers too. C++ is a "hardware hugging" language that allows you to get very close to the hardware (assembly) level while staying relatively portable. It produces wickedly efficent and often remarkably clear code, although you certainly have to know what you're doing to write it.

    Python, PHP, and Perl offer good high level languages that are often used to create active content web sites. These are much more abstract than Java or C++, so they are usually easier for people to use. They also lend themselves to web programming, and that would be a strong argument in my case (much of what I do is web related).

    I'd love to see healdm's reasoning behind his choices. Seeing how people chose and use languages always intrigues me!

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  14. #14
    Join Date
    Apr 2008
    Posts
    27
    Quote Originally Posted by Pat Phelan
    See post #4 above.
    Ah. Yes, the whole subject was much blurrier then, but I see your point now.

    Thanks for your post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •