XML or binary format?
-
Hi guys, I have a question for you. For project files of your application, you store them in XML or unreadable binary format? My only concern is that my users may read the XML project files and inadvertently edit values to some incompatible values and cause the application to crash when loading the project files. What is your opinion on this, may I ask? Thanks!
Why not just check the values of the XML file when you import it and make sure noone has messed with it.
Brad Australian - My Blog Thinking - My Personal [Ad Free] Blog
-
.MORON (Markup Obviously Retains Originality Now) :)
:josh: My WPF Blog[^] The greatest danger for most of us is not that our aim is too high and we miss it, but that it is too low and we reach it. - Michelangelo (1475-1564)
.FTLOGDNMTF (For The Love Of God Do Not Modify This File) .WVOC (Warranty Void On Change)
Brad Australian - My Blog Thinking - My Personal [Ad Free] Blog
-
.FTLOGDNMTF (For The Love Of God Do Not Modify This File) .WVOC (Warranty Void On Change)
Brad Australian - My Blog Thinking - My Personal [Ad Free] Blog
.EDITME :doh:
:josh: My WPF Blog[^] The greatest danger for most of us is not that our aim is too high and we miss it, but that it is too low and we reach it. - Michelangelo (1475-1564)
-
Why not just check the values of the XML file when you import it and make sure noone has messed with it.
Brad Australian - My Blog Thinking - My Personal [Ad Free] Blog
-
Why can't both be used. XML in the initial folder and the binary one in the system folder. Either one is read with caveat for using with choice to implement original.
All things being equal, tommorrow will never equal today
Muhadeeb99 wrote:
and the binary one in the system folder
Installing things in the system folder (I am assuming you mean the root:\Windows or root:\WinNT directory) is really, really bad form unless there are *very* specific reasons for doing so (i.e. device drivers, etc).
¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog
-
.FTLOGDNMTF (For The Love Of God Do Not Modify This File) .WVOC (Warranty Void On Change)
Brad Australian - My Blog Thinking - My Personal [Ad Free] Blog
Bradml wrote:
.FTLOGDNMTF (For The Love Of God Do Not Modify This File)
That would be pretty hilarious to do, and then also register the extension type so that when you click Properties on the file, it shows up with that file description! :)
¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog
-
Hi guys, I have a question for you. For project files of your application, you store them in XML or unreadable binary format? My only concern is that my users may read the XML project files and inadvertently edit values to some incompatible values and cause the application to crash when loading the project files. What is your opinion on this, may I ask? Thanks!
A bit of both, we use XML files, then once the format becomes stable, we add digital signatures to the file. Obviously we don't give the signing tool out. The signing tool is only for developers and is 100% shared source with the internal save/load mechanism. So, if anyone touches the file - everything breaks in a "You've modified the config file, Exit?" type way, but we can still get the users to open the file and read us out the values (or email sections).
Regards, Ray
-
Hi guys, I have a question for you. For project files of your application, you store them in XML or unreadable binary format? My only concern is that my users may read the XML project files and inadvertently edit values to some incompatible values and cause the application to crash when loading the project files. What is your opinion on this, may I ask? Thanks!
I had a problem similar to this and ended up with an XML file as the main config file (different extension though) and a binary file with the default settings in it. That way if the validation from the XML file failed I could quickly load up the binary defaults and then overwrite the XML file with the values from the binary. I've never heard there was a problem with it.
Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck. -
Hi guys, I have a question for you. For project files of your application, you store them in XML or unreadable binary format? My only concern is that my users may read the XML project files and inadvertently edit values to some incompatible values and cause the application to crash when loading the project files. What is your opinion on this, may I ask? Thanks!
I recommend XML, since we're talking about config files, and there's value in allowing an end-user to be able to decipher them. But I don't subscribe to the "if the user messes with the file, it's their problem" mantra. I'd build in semantic checks (as much as is practically possible) into the code that loads and uses the data in the file. /ravi
This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com
-
Bradml wrote:
.FTLOGDNMTF (For The Love Of God Do Not Modify This File)
That would be pretty hilarious to do, and then also register the extension type so that when you click Properties on the file, it shows up with that file description! :)
¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog
.MYN (Meddle Ye Not!) .PDF (Programmer Decapitates Fiddlers) Yes I know PDF is already taken :laugh:
Jason Brown C# Developer
-
<0/><1/><1/><0/><1/><0/><1/><1/><1/>
-- Raaaaaaaaaaaaaaaaaaaaa!
-
:doh:
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
My first real C# project | Linkify!|FoldWithUs! | sighist -
Hi guys, I have a question for you. For project files of your application, you store them in XML or unreadable binary format? My only concern is that my users may read the XML project files and inadvertently edit values to some incompatible values and cause the application to crash when loading the project files. What is your opinion on this, may I ask? Thanks!
Wong Shao Voon wrote:
I have a question for you. For project files of your application, you store them in XML or unreadable binary format? My only concern is that my users may read the XML project files and inadvertently edit values to some incompatible values and cause the application to crash when loading the project files. What is your opinion on this, may I ask?
storing values in binary, or XML, does not negate error checking and default values. If you have a computer crash, and loose half your config file (binary or not) is there any way to save a portion of the config? Also do you ever need to read the data, other than with your application? does anyone else ever have to "look at" the config settings. If your application is the only user, and you can be assured, at no time in the future anyone will EVER need to look at your files, other than your applicaton... perhaps binary is fine. BUT, if you can't make those assurances, and few can since the future is difficult to predict, then XML simply provides a standard method of storing such values so that A) you know what they are without your applicaton (passive view, inspect someone's configuration), B) your customer can interface to the config file (for good or ill, you can't stop this even with binary, only make it more difficult for you and them), and C) open up future capabilities for reading/writing in a standard way. I have done binary files, I have done cfg files (rigid line definition text files), I have done the INI files (my INI library still exists in its oldest version [pre class version] on the net). I never released the latest version because of the move to XML. I have done XML files. Although the initial change to XML was more difficult than any of the above, it does make some things easier.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Chris Losinger wrote:
Binary XML!
or XML described binary files! ;P
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Bradml wrote:
.FTLOGDNMTF (For The Love Of God Do Not Modify This File)
That would be pretty hilarious to do, and then also register the extension type so that when you click Properties on the file, it shows up with that file description! :)
¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog
Jim Crafton wrote:
That would be pretty hilarious to do, and then also register the extension type so that when you click Properties on the file, it shows up with that file description!
Or show a picture of a dungeon master holding an axe, titled: "If you change it, I'll kill your family."
:josh: My WPF Blog[^] The greatest danger for most of us is not that our aim is too high and we miss it, but that it is too low and we reach it. - Michelangelo (1475-1564)
-
Hi guys, I have a question for you. For project files of your application, you store them in XML or unreadable binary format? My only concern is that my users may read the XML project files and inadvertently edit values to some incompatible values and cause the application to crash when loading the project files. What is your opinion on this, may I ask? Thanks!
Years ago, I was programming in a DBase format database language. Basically, it was a simple text file with some index files. Then we were told that Client/Server technologies gave us much more power (which it did). Several years later, they introduced XML, which is nothing more than a text file that contains data. Hmmm, sounds like it's an amazingly bloated version of DBase files. I can't help but wonder how this could have been easier, with less overhead, than XML files. Of course, younger programmers will argue that XML is a relational database with referential integrity. O.K., in some obscure way you can make that argument. But in reality, it is just a text file that can be edited by anyone with notepad.