Field (computing)
   HOME

TheInfoList



OR:

In
data hierarchy Data hierarchy refers to the systematic organization of data, often in hierarchical form. Data organization involves characters, fields, records, files and so on. This concept is a starting point when trying to see what makes up data and whether da ...
, a field (data field) is a variable in a record. A record, also known as a
data structure In computer science, a data structure is a data organization and storage format that is usually chosen for Efficiency, efficient Data access, access to data. More precisely, a data structure is a collection of data values, the relationships amo ...
, allows logically related data to be identified by a single name. Identifying related data as a single group is central to the construction of understandable
computer program A computer program is a sequence or set of instructions in a programming language for a computer to Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
s. The individual fields in a record may be accessed by name, just like any variable in a computer program. Each field in a record has two components. One component is the field's
datatype In computer science and computer programming, a data type (or simply type) is a collection or grouping of data values, usually specified by a set of possible values, a set of allowed operations on these values, and/or a representation of these ...
declaration. The other component is the field's
identifier An identifier is a name that identifies (that is, labels the identity of) either a unique object or a unique ''class'' of objects, where the "object" or class may be an idea, person, physical countable object (or class thereof), or physical mass ...
.


Memory fields

Fields may be stored in
random access memory Random-access memory (RAM; ) is a form of electronic computer memory that can be read and changed in any order, typically used to store working data and machine code. A random-access memory device allows data items to be read or written ...
(RAM). The following Pascal record definition has three field identifiers: firstName, lastName, and age. The two name fields have a datatype of an
array An array is a systematic arrangement of similar objects, usually in rows and columns. Things called an array include: {{TOC right Music * In twelve-tone and serial composition, the presentation of simultaneous twelve-tone sets such that the ...
of character. The age field has a datatype of
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
. type PersonRecord = record lastName : array 1 .. 20 of Char; firstName : array 1 .. 20 of Char; age : Integer end; In Pascal, the identifier component precedes a colon, and the datatype component follows the colon. Once a record is defined,
variables Variable may refer to: Computer science * Variable (computer science), a symbolic name associated with a value and whose associated value may be changed Mathematics * Variable (mathematics), a symbol that represents a quantity in a mathemat ...
of the record can be allocated. Once the memory of the record is allocated, a field can be accessed like a variable by using the dot notation. var alice : PersonRecord; alice.firstName := 'Alice'; The term ''field'' has been replaced with the terms ''data member'' and ''attribute''. The following
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
class Class, Classes, or The Class may refer to: Common uses not otherwise categorized * Class (biology), a taxonomic rank * Class (knowledge representation), a collection of individuals or objects * Class (philosophy), an analytical concept used d ...
has three attributes: firstName, lastName, and age. public class PersonRecord


File fields

Fields may be stored in a
random access Random access (also called direct access) is the ability to access an arbitrary element of a sequence in equal time or any datum from a population of addressable elements roughly as easily and efficiently as any other, no matter how many elemen ...
file. A file may be written to or read from in an arbitrary order. To accomplish the arbitrary access, the
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
provides a method to quickly ''seek'' around the file. Once the disk head is positioned at the beginning of a record, each file field can be read into its corresponding memory field. File fields are the main storage structure in the
Indexed Sequential Access Method Indexed Sequential Access Method (ISAM) is a method for creating, maintaining, and manipulating computer files of data so that records can be retrieved sequentially or randomly by one or more keys. Indexes of key fields are maintained to achieve ...
(ISAM). In
relational database A relational database (RDB) is a database based on the relational model of data, as proposed by E. F. Codd in 1970. A Relational Database Management System (RDBMS) is a type of database management system that stores data in a structured for ...
theory A theory is a systematic and rational form of abstract thinking about a phenomenon, or the conclusions derived from such thinking. It involves contemplative and logical reasoning, often supported by processes such as observation, experimentation, ...
, the term ''field'' has been replaced with the terms ''column'' and ''attribute''.


See also

* *


References

{{DEFAULTSORT:Field (Computer Science) Data modeling