And in what context can the use of JSON be advantageous compared to the use of XML (in web applications)?

Asked

Viewed 119 times

0

I have this question in a simulated test. Besides the ease of writing the Json, and the fact that it is well oriented to objects, what could be the advantages?

The topic: Why and when to use XML instead of JSON? It didn’t help me because I need more information about the advantages of Json.

1 answer

0


JSON

The JSON object is sometimes used as a "communication bridge" because it is light and fast, unlike the XML that has a sharper structure. The way the JSON object is manipulated is also one of the organizational 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, as well as 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 server.

XML

I believe that XML can function as a "mini-bd", recording some information crucial for some system development, whether local or web. The data management system is a little more structured, where you can add parameters and values in a given 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, apart from the fact that you cannot adhere to an Array object within a node, creating several nodes with an identical name.

SOME ADVANTAGES OF JSON

  1. The Parsing is faster
  2. Occupies less bytes (LIGHTER)

Resposta baseada neste link

Browser other questions tagged

You are not signed in. Login or sign up in order to post.