Forum Stats

  • 3,838,471 Users
  • 2,262,371 Discussions
  • 7,900,662 Comments

Discussions

XMLEncoder or Serializable

EdChouaffe
EdChouaffe Member Posts: 125
edited Jun 8, 2011 11:11AM in Java Desktop Applications
Hi guys.

I have been implementing a GUI app and want to persistently save some values to reuse when the application is restarted.
I would like you to give me some tipps on which mechanism is best to achieve this task.

I'm hesitating between XMLEncoder/Decoder or using the ObjectOutputStream.

Best reagrds.

Edmond

Answers

  • 796440
    796440 Member Posts: 19,179 Gold Trophy
    EdChouaffe wrote:
    Hi guys.

    I have been implementing a GUI app and want to persistently save some values to reuse when the application is restarted.
    I would like you to give me some tipps on which mechanism is best to achieve this task.
    The one that best meets your specific requirements is best.

    Have you read the docs for both, and maybe look at a couple examples or tutorials? If not, why not?

    Do you understand the fundamental differences between them?

    Did you try them both? If not, why not? It's only a few lines of code, and you can hide the implementation behind an interface.

    Did you have specific problems with one or the other?

    Do you have more specific requirements than "save and reload"? If not, I doubt you'll notice a difference between the two.
This discussion has been closed.