XML or binary format?
-
The kind of users who would go fiddling around in XML config. files either know what they are doing, make backups or have no right to complain when something goes wrong. I find it hard to believe someone could inadvertently edit an XML config file. Its not like you stored it on the desktop and named it "todolist.txt" Right? And the benefits of having it readable and editable on the client-side are numerous. So, text-based (XML, CSV, Java style, JSON etc.) would be my choice.
regards, Paul Watson Ireland & South Africa
Shog9 wrote:
And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...
Amen to that - they mess with it, it's on their heads.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
As ever, it depends on the job in hand, there's no 'one size fits all' option with this sort of thing.
Wong Shao Voon wrote:
my users may read the XML project files and inadvertently edit values
I make it a personal rule to always validate input, regardless of where it's from, for this very reason. If data is stored in a file, it can be changed outside of your control - *always* validate it!
- Dy
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
-
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!
XML. Like others have said, if the users screw with it, it's their problem.
Software Zen:
delete this;
-
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!
-
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!
You can use XML, but the file extension could be something other than .xml This allows you to have highly-readable XML, but the user would have to jump through extra hoops to open it and edit the data.
: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 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
KISS. Choose a format that fits the problem. Don't try and do both. You'll end up with more code to test and support. Multiple points of breakdown.
regards, Paul Watson Ireland & South Africa
Shog9 wrote:
And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...
-
You can use XML, but the file extension could be something other than .xml This allows you to have highly-readable XML, but the user would have to jump through extra hoops to open it and edit the data.
: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)
.JSCML (Josh Smith Configuration Markup Language.)
regards, Paul Watson Ireland & South Africa
Shog9 wrote:
And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...
-
.JSCML (Josh Smith Configuration Markup Language.)
regards, Paul Watson Ireland & South Africa
Shog9 wrote:
And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...
.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)
-
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