"danny van elsen" <da*************@hotmail.com> wrote in message
news:pa****************************@hotmail.com...
hello all,
in my application, I want to save an object to a file: what would be
the best way to do this?
"Best" depends upon context and opinion.
binary or text?
Text will be more portable. Binary will constrain use
to a specific platform/implementation (or 'category'
of them). The 'trade-off' is that binary can often
have better performance than text (the 'footprint'
will usually be smaller).
self written
Self-written is always an option. It has the advantage
that it you can make it work exactly how you want, and
you can modify it at will.
or existing library?
Existing libraries can save large amounts of time and effort,
but sometimes might restrict you more than you'd like (though
many libs come with source, and if you understand it, you
could change it -- but often this imposes usage restrictions)
If you're looking for a 'get it done as quickly as possible'
solution, try to find a library that does what you need.
If you can't, you could try modifying a library or creating
your own.
If your motivation is learning, or functionality for which
you can't find a library, or perhaps simply 'for fun', try
writing it yourself.
IMO the most pertinent question to ask yourself when determining
how to serialize data, is "how/when/where will this data need
to be accessed?"
HTH,
-Mike