Results 1 to 2 of 2

Thread: Saving hierarchical structures of data.

  1. #1
    Join Date
    Oct 2008
    Posts
    71
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Saving hierarchical structures of data.

    Hi

    I'm about to start working on a new project which involves saving hierarchical data structures, for instance lets suppose we have 4 types of objects: A, B, C, D, P1, P2

    A has many B, or D
    B has many C,
    C has many D
    and D has many P1, and P2

    Here is an image describing this relationship.


    The relationship is not limited to the aggregation, lets say B and C might share common properties and be inherited from some other object.

    Now I need a solution to store this kind of objects and their relationships. I was thinking of two ways:

    1) Create a SQLite database and define corresponding tables and their relationships. Taking this path will require building some kind of Object Relational Mapper, which complicates thing quite a bit.

    2) Use some kind of a serialization process (binary or XML??). Here things are not as complicated as in case of the pervious path.

    In my understanding the best solution should leverage Qt capabilities as much as possible, so I wanted to get some advice from the community. Which way do you think is more favorable in terms of Qt framework? Maybe there is a better way? How would you approach building the ORM layer using Qt classes?

    Thanks
    Anton
    Anton

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Saving hierarchical structures of data.

    I would go for the second solution. You can use QDataStream for the serialization if you want.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Saving pure plot data to image file
    By Debilski in forum Qwt
    Replies: 4
    Last Post: 7th April 2009, 17:02
  2. Best way to display lots of data fast
    By New2QT in forum Newbie
    Replies: 4
    Last Post: 16th October 2008, 22:46
  3. APIs and Data structures
    By crazymoonboy in forum Qt Programming
    Replies: 0
    Last Post: 30th September 2008, 07:56
  4. Replies: 2
    Last Post: 17th April 2006, 21:30
  5. Record update windowd entered data saving
    By MarkoSan in forum Qt Programming
    Replies: 56
    Last Post: 18th January 2006, 18:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.