상세 컨텐츠

본문 제목

JSON 튜토리얼 1

개발

by 동동주1123 2012. 2. 3. 16:28

본문

출처:  http://www.w3resource.com/JSON/introduction.php 

Introduction to JSON

This page introduces you to JSON - JavaScript Object Notation. We have discussed definition, history, usage and Comparison with XML of JSON in this page.

What is JSON

JSON is a lightweight text-based open standard data-interchange format.

(가벼운 텍스트 베이스의 표준 데이타 전송방법 )

You can read and write JSON easily.
(쉽게 읽고 쓸수 있다) 

JSON is derived from a subset of JavaScript programming language (Standard ECMA-262 3rd Edition—December 1999).

(자바스크립트의 하위) 

It is entirely language independent and can be used with most of the modern programming languages.

(완전히 독립된 언어이며 대부분의 언어와 호환된다)

JSON files are saved with .json extension.
(확장자는 .json) 

Internet media type of JSON is "application/json".
(인터넷 미디어 타입은 "application/json") 

JSON LOGO

A simple example of JSON (간단한 예제)

{
"Students": [ // 학생 
{
"Name": "Amit Goenka", // 학생 내부의 name 데이타 1
"Major": "Physics" // major 데이타 1
},
{
"Name": "Smita Pallod",  // 학생 내부의 name 데이타 2
"Major": "Chemistry"  // major 데이타 2
},
{
"Name": "Rajeev Sen",
"Major": "Mathematics"
}
]
}

The above example shows information about three students - their name and major subjects are stored using JSON.
(세명 학생의 이름과 전공정보를 저장한 json데이타)
 

Though you need to read and understand JSON structures to understand the concept of JSON better, the following image may help you to understand the concept of JSON a little better.

(JSON을 이해할 필요가 있지만 다음 그림은 JSON을 이해 하는데 도움을 줄것이다) 

JSON introduction tutorial, w3resource

History of JSON(역사)

The name behind popularizing the JSON is Douglas Crockford. He used JSON is his company State Software around 2001.
(대중화의 주역) 

In 2005, Yahoo started using JSON in it's web services.
(야후가 2005년에 웹서비스에 사용 시작) 

In later 2006, Google started offering JSON in it's Gdata web protocol.
(2006년에 구글이 GDATA 웹 프로토콜에 JSON을 제공하기 시작)
 

Today, JSON is one of the most widely used data-interchange format in web, and supported by most of the Web APIs (like twitter api) to fetch public data and creating applications out of them.

(가장 널리 사용되는 데이터 교환 포멧중 하나이며 이러저런 곳들에 사용중이다)

Usage(사용)

Various Web Services and APIs use JSON format to provide public data. Using the associated Service / API, you can fetch that data and use it to create applications.

(다양한 웹서비스와 API들은  공개 데이타를 제공하는데 JSON을 사용)
(관련된 서비스와 API를 이용하여 데이타를 패치 하거나 새로운 어플을 만들수 있다)
 

For example, if you click this link, you would get user information about 'w3resource' in twitter and last two tweets of the user.

(여기를 클릭하면 w3resource의 트위터등에서의 정보를 볼수 있다)

If you look the available data closely you will see meaningful information in a very structured way.

(당신이 사용한 데이타를 자세히 보면 , 매우 구조적인 방법으로 의미 있는 정보를 볼수 있을것이다)

But for now, since we yet to discuss JSON structure, you can see the user information in a much more presentable way in the following pictorial presentation (output).

( json 구조를 논하지 않지만, 아래에서 흉하진 않은 형태의 데이타를 볼수 있다- 위의 w3resource 데이타)

twitter example

JSON format (or a close derivative of that) is used by various NoSQL databases to
store data. For example MongoDb, CoucheDB uses JSON format to store data.

(MongoDB등의 NoSQL DB들은 JSON을 사용한다) 

This is a simple document (as record in SQL) stored in MongoDB. MongoDB uses
BSON (a derivative of JSON) format to store data.
(이것은 몽고DB에 저장된 간단한 문서 있다)
(MongoDB는 BSON 포멧을 사용한다)

FirstName="Arun", Address="St. Xavier's Road", Spouse=[{Name:"Kiran"}], Children=[{Name:"Rihit", Age:8}]. 
FirstName="Sameer",Address="8 Gandhi Road".

Comparison with XML(XML과 비교)

Since both JSON and XML are mean to be a data interchange format, there is always a comparison between JSON and XML.

(둘다  데이타 교환 포멧이기에 두 넘은 항상 비교된다) 

The similarity between them lies in the points that, both of them are plain text, human readable and can be used with most of the modern programming languages.

(둘다 사람이 읽을 수 있는 텍스트이고 현대적인 프로그래밍 언어와 사용할 수 있다는데 그 위치를 점유 하고 있다)

But unlike XML, JSON supports data structures (name/value pairs and ordered list of values) which are universal in nature and supported by most of the modern programming languages in some form or other. Which makes JSON more comprehensible, easy to get started with (because you already know the format if you familiar with one or more modern programming languages) and thus easy to use.

(JSON이 좀더 이해하기 쉽다...) 

Experiences of developers say that JSON is faster that XML.
(개발자들은 XML보다 JSON을 좋아라함) 

XML is redundant in nature. Unlike JSON.
(XML은 JSON과는 달리 redundant함) 

What you will learn in w3resource JSON tutorial(뭘 배울래)

Structure and datatypes of JSON.(구조와 데이타 형식)

Working with JSON and PHP.(PHP에서 사용)

Working with JSON and JavaScript.(자바스크립트에서 사용)

After reading this tutorial, you will gain knowledge to use JSON in practice.(읽고 난후에 연습으로 지식을 습득할거다)

'개발' 카테고리의 다른 글

jdk 1.6 x64 파일  (0) 2012.02.08
우분투 다운로드하기  (0) 2012.02.03
아파치 + 톰켓 연동  (0) 2012.02.02

관련글 더보기