Results 1 to 6 of 6
  1. #1
    jdipierro is offline Member
    Join Date
    May 2010
    Posts
    3
    Rep Power
    0

    Default Types of Data Persistence

    Hey all,

    I'm working on a program that I need data persistence with, and I was wondering what options I had?

    I know that I can read/write text files but I don't feel that's the best method for the program I'm trying to create (something to help me keep track of credit card spending)

    The only other method that I know for persistence is to use a database, but I was wondering one thing:

    If I were to send the program to someone else to use, would they have to install a database program on their computer? If so is there any alternative to a database for storing information?

    I don't quite understand how programs store data if it's not written in a plain text file, and not stored in a database.

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    A lot more recent open office kinds of documents use a complicated XML type of file structure.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by jdipierro View Post
    If I were to send the program to someone else to use, would they have to install a database program on their computer? If so is there any alternative to a database for storing information?
    It depends on the way you want to design your application.

    One possible way is, if you don't like to keep a database on clients' PC, keep a central database in a server and communicate with it. But the problem is that all of your clients need to be connect to the internet. Best way to communicate is though web services, using XML streams.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,967
    Rep Power
    19

    Default

    I wouldn't recomend a central store, even if you aren't suppliyng this to clients and are only doing this for friends/colleagues. This is simply because financial data might be considered "sensitive".

    Keep it locally, which you've already thought comes down to a database or some form of text file (either plain, xml, whatever). The decision on what to do there is then a case of what it is this thing is intended to do...and what your knowledge areas cover...and if you are using this as a learning exercise.

    Me? I'd use a database, but then I know what I'm doing in that field, and I could probably code it faster than xml, which would be my second choice (albeit a bit distant).

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    I agreed that use of a central store is not a good idea, specially when you want to log transaction details. Have to use replicas within a distributed store. But maintaining that is not an easy task at all.

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by Tolls View Post
    Me? I'd use a database, but then I know what I'm doing in that field, and I could probably code it faster than xml, which would be my second choice (albeit a bit distant).
    In most of the case I use XML to store data, and to transfer as well. Main advantage I've seen is that system independent and vendor independent standard.


Similar Threads

  1. primitive Data types
    By Manfizy in forum New To Java
    Replies: 2
    Last Post: 07-07-2009, 08:29 PM
  2. Returning complex data types from a web method
    By Tshegofatsom in forum Advanced Java
    Replies: 6
    Last Post: 05-15-2009, 03:30 PM
  3. Array of different data types?
    By venkatteshb in forum New To Java
    Replies: 1
    Last Post: 08-27-2008, 05:42 PM
  4. Primitive data types of Java
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-28-2008, 07:29 PM
  5. Converting data types
    By bluekswing in forum New To Java
    Replies: 4
    Last Post: 01-12-2008, 12:48 AM

Tags for this Thread

Posting Permissions

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