Choice of data system - Programmer

This is a discussion on Choice of data system - Programmer ; Hi, I'm a student and I'm currently developping a backup application in MFC (C++). My app basically consists of a Treeview and a listview control which holds all the files I want to back up and the ones that have ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Choice of data system

  1. Choice of data system

    Hi,

    I'm a student and I'm currently developping a backup application in MFC
    (C++). My app basically consists of a Treeview and a listview control which
    holds all the files I want to back up and the ones that have already been
    backedup.

    My problem : which is the best solution for saving my data (treeview
    structure with files info ...). I think that loading the whole tree
    structure (and file list and info...) would take too much memory.

    I thought of using a database to store all my data. What do you think ?
    I need to be able to quiclky search for data, for example when the user
    selects a folder (virtual folder) , the listview must display the files
    contained in this virtual folder.

    What would a professionnal developper choose ?

    Thank you very much for helping !

    Will
    __________________________________________________ ________________ Goulou
    ICQ#: 111148586 Current ICQ status: + More ways to contact me
    __________________________________________________ ________________



  2. Re: Choice of data system

    Hi,
    The database solution would be great if you want to provide concurrent
    multi-user access to that data structures with your app.
    There is a popular model for mapping hierarchical (tree) structures to
    "flat" database tables - by specifying parent record. For example, lets look
    at this table:
    Columns:
    ID Name ParentID
    0 A NULL
    1 B 0
    2 C 0
    3 D 1
    4 E 3
    Each record has an unique parent. (records with ParentID=NULL will be
    roots). But any record can have an unlimited number of "children". For
    example, A is the root record with two children: B and C.
    But you can store this data table in binary file (declare a struct for your
    data fields and save structs as a whole). This method is much simpler than
    database access and will be perfect for single-user desktop applications.
    Another possible solution is XML. You can write a simple recursive procedure
    for saving tree into text file with XML tags. Parsing the XML structure is
    rather difficult but there are many free parsers - for example, MS XML DOM
    and SAX. This approach is much more flexible (your data structure can
    change) and good for internet applications.
    Hope this will help.

    --
    WBR, Vitaly Brusentsev,
    AWinstall development team.
    http://www.awinstall.com mailto:vb@awinstall.com

    "William A." wrote in message
    news:3f7c9ee1$0$20623$626a54ce@news.free.fr...
    > Hi,
    >
    > I'm a student and I'm currently developping a backup application in MFC
    > (C++). My app basically consists of a Treeview and a listview control

    which
    > holds all the files I want to back up and the ones that have already been
    > backedup.
    >
    > My problem : which is the best solution for saving my data (treeview
    > structure with files info ...). I think that loading the whole tree
    > structure (and file list and info...) would take too much memory.
    >
    > I thought of using a database to store all my data. What do you think ?
    > I need to be able to quiclky search for data, for example when the user
    > selects a folder (virtual folder) , the listview must display the files
    > contained in this virtual folder.
    >
    > What would a professionnal developper choose ?
    >
    > Thank you very much for helping !
    >
    > Will
    > __________________________________________________ ________________ Goulou
    > ICQ#: 111148586 Current ICQ status: + More ways to contact me
    > __________________________________________________ ________________
    >
    >




+ Reply to Thread