[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: List of differences between XML and JSON?

  • From: Dimitre Novatchev <dnovatchev@gmail.com>
  • To: Thomas Passin <list1@tompassin.net>
  • Date: Sun, 3 May 2015 09:24:00 -0700

Re:  List of differences between XML and JSON?
 
On Sun, May 3, 2015 at 5:42 AM, Thomas Passin <list1@tompassin.net> wrote:
>
> Well, actually, there is nothing to indicate that these two objects are the same.  
> A _javascript_ engine would create two objects, and if you were to change
> the properties of one, the other's properties would not automatically change.
 
Agreed. The example, and the way I am using this is strongly based on assumption that the objects are immutable.

We also need to remember, that JSON is widely used not only for representing _javascript_ objects, but also in other important cases -- for example to express the input data for REST web services (seen in practice with the most widely used HTTP verbs)  and for their response.

JSON is just a specific serialization mechanism -- how JSON would be de-serialized depends solely on the receiving end -- it may be serialized to something completely different than a _javascript_ object.

Any good particular implementation would use objects immutability for sharing and efficiency.
 
For the XPath 3.1 map datatype, this is what makes possible to have efficient (sub-linear) implementations of   map:put() and    map:remove().
 

Even in a language such as C# there are some immutable objects, such as the string object. This led to a powerful string sharing feature: interned strings: https://msdn.microsoft.com/en-us/library/system.string.intern(v=vs.110).aspx

 
 
--
Cheers,
Dimitre Novatchev
 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.