Jump to content

First class (computing)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Steve espinola (talk | contribs) at 20:08, 9 August 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Identity

In database modeling, a first class item is one that has an identity independent of any other item. The identity allows the item to persist when its attributes change, and other items to claim relationships with the item.

Items

As a general rule, first class items represent things rather than relationships. For example, the database representations of a human and of a company are each first class items. However, the fact that the person is an employee of that company is not, nor is data about that relationship, e.g. information about the salary the company pays to its employee.

Tables

Typically, a relational database will include several tables, each of which contains rows representing first class items of a given type (e.g. a table of people, a table of companies). It will also contain other tables representing relationships between these first class items.

Rows

In a table representing first class items, one column of the table will typically contain a different integer assigned to each row (effectively, to each item) as a unique identifier: that is to say, unique for objects of this type; objects of different types, represented in different tables, can coincidentally have the same identifier, but the coincidence is meaningless.

Tuple

In a relational database, a table representing a relationship between two or more first class items (or data about that relationship) will usually not have special identifiers for its rows. Instead these rows will be identified by an ordered tuple consisting of unique identifiers of the first class items involved in the relationship.