Difference between revisions of "Field (computer science)"
Karl Jones (Talk | contribs) (Created page with "In computer science, data that has several parts, known as a record, can be divided into '''fields'''. == Relational databases Relational...") |
Karl Jones (Talk | contribs) (→See also) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
In [[computer science]], data that has several parts, known as a [[Record (computer science)|record]], can be divided into '''fields'''. | In [[computer science]], data that has several parts, known as a [[Record (computer science)|record]], can be divided into '''fields'''. | ||
− | == Relational databases | + | == Relational databases == |
[[Relational database|Relational databases]] arrange data as sets of database records, also called rows. | [[Relational database|Relational databases]] arrange data as sets of database records, also called rows. | ||
Line 9: | Line 9: | ||
== Object-oriented programming == | == Object-oriented programming == | ||
− | In [[object-oriented programming]], field (also called data member or member variable) is the data encapsulated within a class or object. | + | In [[object-oriented programming]], field (also called data member or [[member variable]]) is the data [[Information hiding|encapsulated]] within a class or object. |
In the case of a regular field (also called instance variable), for each instance of the object there is an instance variable: for example, an Employee class has a Name field and there is one distinct name per employee. | In the case of a regular field (also called instance variable), for each instance of the object there is an instance variable: for example, an Employee class has a Name field and there is one distinct name per employee. | ||
Line 21: | Line 21: | ||
* [[Class variable]] | * [[Class variable]] | ||
* [[Data hierarchy]] | * [[Data hierarchy]] | ||
+ | * [[Information hiding]] | ||
* [[Instance variable]] | * [[Instance variable]] | ||
+ | * [[Locality of reference]] | ||
+ | * [[Member variable]] | ||
* [[Mutator method]] | * [[Mutator method]] | ||
* [[Record (computer science)]] | * [[Record (computer science)]] |
Latest revision as of 14:25, 24 August 2016
In computer science, data that has several parts, known as a record, can be divided into fields.
Relational databases
Relational databases arrange data as sets of database records, also called rows.
Each record consists of several fields; the fields of all records form the columns. Examples of fields: name, gender, hair color.
Object-oriented programming
In object-oriented programming, field (also called data member or member variable) is the data encapsulated within a class or object.
In the case of a regular field (also called instance variable), for each instance of the object there is an instance variable: for example, an Employee class has a Name field and there is one distinct name per employee.
A static field (also called class variable) is one variable, which is shared by all instances.
Fields are abstracted by properties, which allow them to be read and written as if they were fields, but these can be translated to getter and setter method calls.
See also
- Class variable
- Data hierarchy
- Information hiding
- Instance variable
- Locality of reference
- Member variable
- Mutator method
- Record (computer science)
External links
- Field (computer science) @ Wikipedia