?
Solved

What structure should file saving take?

Posted on 2007-11-16
6
Medium Priority
?
189 Views
Last Modified: 2010-03-30
I am currently developing a standalone application that will have the following structure:

File
General Information
         - Group 1
      - Table 1
      - Table 2
      - Notes
                   > Group A
                 -Table
                 -Notes
                 -Pictures
        - Group 3
      - Table 1
      - Table 2
      - Notes
         - Group 4
      - Table 1
      - Table 2
      - Notes

(note – there can be up to 30 groups)

At the moment all the above are all stored as arrays, vectors, variables etc..  

The application will have functionality to import specific elements – e.g. Table 1 in File 1 being imported/reused in File 2.

I have developed database applications in the past and the nature of this application does not lend to a DB.  Any thoughts on the best way to “SAVE” this information?  I.e. Text File, Custom File etc?

Thanks
Angus

0
Comment
Question by:amacfarl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 20298000
As it's a tree structure, it would tend to lend itself to XML or JSON or some other tree structure based format in my opinion...

Especially if more than one application is going to need this file or you are going to be transmitting this file across the network to another service
0
 
LVL 35

Expert Comment

by:TimYates
ID: 20298007
(if you are transmitting it, XML would be better as you can define a schema)
0
 
LVL 2

Author Comment

by:amacfarl
ID: 20298058
Sorry... misunderstanding.  It is not a tree structure, the structure above is purely to illustrate the object hierarchy.  eg. Group1 is a class that contains several tables, pictures, and other classes which also contain tables, pictures etc..

0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 35

Expert Comment

by:TimYates
ID: 20298104
Yeah, so that can be thought of logically as a tree of objects...

ie:

Group 1 contains tables
    each table contains other objects

etc...

Or am I missing the point entirely?  (it's very possible as it's a Friday, and my head is swimming with work-based javascript at the moment) ;-)
0
 
LVL 2

Author Comment

by:amacfarl
ID: 20299000
Thanks Tim for getting back to me.  

My thoughts on using XML or JSON is that it requires effort to create a file structure and parse it and load it etc. etc.  it is also something that is readiable and editable by notepad which causes a problem.  The tool that I am developing is going to be used by IT professionals and they will start playing with the contents of the file outside the program - thus it means that further effort will be required to develop validation etc.. etc.

A few years ago (in the 90's :-)) I developed a program that simply saved the objects directly.  I recall having a method that I simply past it the object and it saved it.  Serialiazation i think.  If so, what are your views?

Thanks
Angus

P.S  Bring on the weekend.... sitting in an Airport lounge about to take my 6th flight this week.... only one more after this!!!!!

0
 
LVL 35

Accepted Solution

by:
TimYates earned 1500 total points
ID: 20299433
The only worry I have with serialization is that it is not guaranteed to work over different versions of your application unless you're careful

It can be handled by being careful with changing your core classes, but if it goes wrong it's hard to fix as the serialized files are binary...

A framework like XStream* may help here

http://xstream.codehaus.org/

It serializes java objects to XML, so gives you all the ease of serialisation, but with all the hackableness of xml ;-)

Tim
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month11 days, 10 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question