Monday, October 23, 2023

Basic Introduction To JSON For Angular Application

 Json is a data exchange[storage] format in the form of key|value pairs

This is used to transfer data between client and server in ajax implementation
*syntax:
  1.single json object
       {"key1":"value1","key2":"value2",..}

  2.json collection[array of json objects]
       [
         {"key1":"value1","key2":"value2",..},
               ...
       ];


*Json advantages over xml:
 1.developer friendly[easy to manipulate->read | write]
 2.light weight data storage[less memory compare to xml]-->communication faster->better performance
    eg:
     <product>                           --->xml data storage---> around 90 bytes
      <prodid>p001</prodid>
      <prodname>dell</prodname>
      <prodprice>50000</prodprice>
     </product>


     {"prodid":"p001","prodname":"dell", --->json data storage---> around 50 bytes  
                      "prodprice":50000} 


3.browser will perform faster interpretation

   xml----->browser---->xml parser-->loading data  -------->script[programming]
                                     into memory in
                                     hierarchical format

   json---->browser---->script




No comments:

Post a Comment

Thank you for visiting my blog

Kubernetes

Prerequisites We assume anyone who wants to understand Kubernetes should have an understating of how the Docker works, how the Docker images...