views:

53

answers:

1

Hello Team,

Can I have the Information of what is the difference between JSON & GSON. I have read the word GSON at some places while looking for JSON particularly.

I don't know the clear difference between the two.

Another thing is the Words; "Marshalling" and "Unmarshalling" associated with JSON Parsing, I wonder what they are actually.

Thank You, david

+1  A: 

JSON is a data-interchange format. GSON is a Google library to parse JSON resources. With regards to the Marshalling, it basically means a way to translate data structures (like objects in an OOP language) to JSON... for instance:

// Java object
class Book {
  private String title;
  private String isbn;
  private Set<author> authors;
}

@Entity
class Author {
  private String firstName;
  private String lastName;
}

To...

{title:   "Vocation Createurs",
 isbn:    "2829302680",
 authors: [{firstName: "Barbara", lastName: "Polla"},
           {firstName: "Pascal",  lastName: "Perez"}]} 
Cristian