• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Saving and loading question

 
Marcus Senna
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, I am creating an application which allows users to simulate certain communications protocols. This application would allow users to configure networks using network components such as routers and hosts by dragging and dropping images of them onto a configuration area. Therefore, as an image is dropped onto the area, objects would be created and certain parameters set.
One of the requirements of the application is to allow users to save configurations so that there could be loaded in the future.
Could anyone give me ideas on how I would be able to save the configurations along with the parameters? Thanks in advance.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Broadly, there are two ways: save the Java objects directly using serialization, or define a structured file format to translate your objects into as they are saved. Serialization is easy, but opaque and potentially fragile if your code changes. Defining and using a custom file format may or may not be difficult. It might be something you define from scratch, or you could just use an established format like XML. The advantage of using something like XML is you can use a pre-existing parser and tools for writing the file format.
 
Marcus Senna
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you tell me of any website or book that would give me information on using either of these two techniques?...thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic