Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Name–value pair

From Wikipedia, the free encyclopedia
(Redirected fromAttribute–value pair)
Data representation method in computing systems
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Name–value pair" – news ·newspapers ·books ·scholar ·JSTOR
(December 2009) (Learn how and when to remove this message)
Example of aweb form with name-value pairs

Aname–value pair, also known as anattribute–value pair,key–value pair, orfield–value pair, is a fundamentaldata representation incomputer systems andapplications. Designers often desire an open-endeddata structure that allows forfuture extension without modifying existing code or data. In such situations, all or part of thedata model may be expressed as a collection of2-tuples in the form<attribute name, value> with each element being an attribute–value pair. Depending on the particular application and the implementation chosen byprogrammers, attribute names may or may not be unique.

Common examples includeJSONobjects such asdatabase records where a column maps to a stored value (e.g.,usernamejohndoe),HTTP headers likeContent-Type:text/html, andconfiguration files with settings expressed assettingType=1.

Examples of use

[edit]

Some of the applications where information is represented as name-value pairs are:

Use in computer languages

[edit]

Somecomputer languages implement name–value pairs, or more frequently collections of attribute–value pairs, as standard language features. Most of these implement the general model of anassociative array: an unordered list of unique attributes with associated values. As a result, they are not fully general; they cannot be used, for example, to implement electronic mail headers (which are ordered and non-unique).

In some applications, a name–value pair has a value that contains anested collection of attribute–value pairs. Somedata serialization formats such asJSON support arbitrarily deep nesting.[2]Other data representations are restricted to one level of nesting, such asINI file's section/name/value.

See also

[edit]

References

[edit]
  1. ^Peter W. Resnick."Internet Message Format".tools.ietf.org. Retrieved2018-10-02.
  2. ^"JSON Objects".www.w3schools.com. Retrieved2018-10-02.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Name–value_pair&oldid=1313000797"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp