in Education by
I do alot of systems programming where my apps have no chance of being used to communicate over the web or viewed through a browser. But, there has been some push by management to use XML. For example, if I want to keep a time log I could use a text file like this: command date time project in 2008/09/23 08:00:00 PROJ1 change 2008/09/23 09:00:00 PROJ2 out 2008/09/23 12:00:00 PROJ2 in 2008/09/23 01:00:00 PROJ3 out 2008/09/23 05:00:00 PROJ3 The XML would look something like this: ... Some of the initial advantages of the text version that I see is that it is easily readable and parsable with regex. What are the advantages to using XML in this case? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
There's absolutely nothing wrong with using text-based data formatting. It has been the de-facto standard for decades. Big huge mainframe financial systems still use it today. The benefits are that it's trivial to produce, trivial to consume and incredibly lightweight. And how about log files? Do you know any production platform that doesn't generate its log file in a delimited text format (web, app, db server)? The downside of flat text files is that if the format changes, then you have to modify both the producer and the consumer ends non-trivially to be able to support the format change. Of course if it's just a human consuming the result, then you only have to change the producer. The beauty of XML is that the parsing of the data is independent from not only the data but the format of the data. Logically you pass it both the data and the data format, and presto! Everything works. It's not exactly that simple, but that's the premise. You can change the format of the data, and your producers and consumers only have to change trivially (if at all). The ugly of XML is that it can be a huge performance dog (SOAP anyone?) and very heavy weight. You definitely pay a price for its extensibility. There are cases where it is absolutely the optimized technical solution for a given problem domain, and there are other cases where it's not. So if it's a simple log that a human will read, keep it flat file. If it's a simple app communicating with another single app and the communications will not change dramatically over time, flat file is definitely faster and lighter to implement, but XML is not a bad choice. If multiple apps need to consume the data you're providing or if the volume of communication change is going to be high, then go with XML. The maintenance of the interface will be more easily maintained over time if you do.

Related questions

0 votes
    I do alot of systems programming where my apps have no chance of being used to communicate over the web ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    I do alot of systems programming where my apps have no chance of being used to communicate over the web ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    I do alot of systems programming where my apps have no chance of being used to communicate over the web ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    I do alot of systems programming where my apps have no chance of being used to communicate over the web ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    I do alot of systems programming where my apps have no chance of being used to communicate over the web ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    I do alot of systems programming where my apps have no chance of being used to communicate over the web ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    Asynchronous Javascript and XML (Ajax) is technique for creating better, faster, and more interactive web applications. In addition to ... Perl, and C++ D. Java, ASP, and C#...
asked Mar 10, 2023 in Technology by JackTerrance
0 votes
    When working with Ajax applications, which is faster, XML or JSON? A. XML, because it is extensible B. JSON, ... D. JSON, because it is already parsed into a JavaScript object...
asked Mar 10, 2023 in Technology by JackTerrance
0 votes
    I am using a third party application and would like to change one of its files. The file is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am using a third party application and would like to change one of its files. The file is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am using a third party application and would like to change one of its files. The file is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am using a third party application and would like to change one of its files. The file is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 10, 2022 in Education by JackTerrance
0 votes
    I am studying for an exam and I am confused as to how canonical vs. non-canonical input/output ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 9, 2022 in Education by JackTerrance
...