And in what context can the use of JSON be advantageous in relation to the use of XML (in web applications)? [duplicate]

0

I have this question in a test simulation. Aside from Json's ease of writing, and being well object oriented, what could be the advantages?

The topic: Why and when using XML instead of JSON? It did not help because I need more information about the advantages of Json.

    
asked by anonymous 21.04.2018 / 16:11

1 answer

0

JSON

  

The JSON object is sometimes used as a "communication bridge" because it is lightweight and fast, different from XML that has a sharper structure. The way the JSON object is manipulated is also one of the organizing facilities, making the code cleaner and dedicated only to the data structure.   Not to mention that it is possible to insert an Array directly into an item, just like another JSON object.

     

This ease of handling along with speed / lightness is one of the main reasons that makes JSON the perfect tool for data communication with the server.

XML

  

I believe that XML can function as a "mini-bd", recording some crucial information for the development of some system, be it local or web.    The data management system is a bit more structured, where you can add parameters and values to a particular item.

     

Although the structure of an XML is organized and well understood, the interaction with the Web can leave a little more to be desired, because it is a little more complicated to work to rescue all this information, taking the fact that you there is no way to join an Array object inside a node, creating several nodes with identical names.

SOME ADVANTAGES OF JSON

  
  • Parsing is faster
  •   
  • Takes less bytes (LIGHTER)
  •   

    Resposta baseada neste link

        
    21.04.2018 / 19:18