Entity (computer science)

from Wikipedia, the free encyclopedia

As an entity (also called information object , English entity ) is referred to in data modeling as an object to be uniquely determined, about which information is to be stored or processed. The object can be material or immaterial, concrete or abstract. Examples: a vehicle, an account, a person, a state.

Entity, entity type

Entities are individually identifiable objects / people etc. These can be assigned individual properties (such as color = red, date of birth = August 28, 1749, altitude = 2962 meters, temperature = - 4.5 degrees) - in a given area of ​​observation. assign. Entity types (sometimes called entity classes) can be derived by typing (recognizing the same attributes / characteristics of entities) ; from several people z. B. CUSTOMERS. The individual customers are considered entities , i.e. specific characteristics (instances) and have an identity .

The set of entities of an entity type is called the entity set - which (depending on the selection) can include all, only certain or no entities. Entities as elements of an entity set are distinguished by their properties (values ​​of attributes). Each entity of an entity type is distinguished from the other entities of the same entity type by a unique value of an identifying attribute or an attribute combination (e.g. the chassis number for a single car or the license plate number for a single registration). This attribute or this combination of attributes is called identification, identifier or ID for short.

An entity can as well with themselves in an other entities relationship (English relationship are). Example: Person X <is the owner of vehicle> Y, Person A <is the superior of> Person B; <...> = meaning / name of the relationship.

The typification of entities and the possible relationships between entities (to relationship types ) is done through abstraction . This differentiation between instances and types is necessary in order to arrive at a data model . The entities become entity types and their relationships become relationship types, which are graphically represented in an entity-relationship diagram . In parlance, instead of the correct term “entity type”, the shorter word “entity” is sometimes used, whereby the context usually shows whether an object instance (entity) or its typification (entity type) is meant.

To create a relational database , for example , based on the data model, an entity type is implemented as a table in the database. Each line of this table (also called a data record or tuple ) will represent an entity, the identifier will become the primary key , and relationships will become the foreign key .

Generalization / specialization

If attributes and / or relationship types appear in different entity types that are identical for the same entity, they can be managed and combined under a new entity type, which is referred to as generalization. The resulting entity type takes on the common attributes. The original entity types remain; they “inherit” the attributes of the new entity type. So z. B. the entity types customer and supplier are merged in addition to the generalized entity type business partner . B. Name, address, bank details etc. can be used for both customers and suppliers . The reverse (recognizing that attributes of an entity type only occur in certain situations / roles) can also lead to a new entity type (e.g. private customer ) and is known as specialization.

The generalization, specialization and inheritance of the attributes correspond to the basic idea of object-oriented programming .

Examples

Entity types are:

  • Article with (for example) the identifying attribute EAN
  • Book with identifying attribute ISBN and descriptive attribute stock quantity (in the case of a publisher with many copies ( identical from the publisher's point of view ))
  • Book with identifying attribute ISBN plus copy number (in the case of a library)
  • Account with the identifying attribute account number
  • Customer with the identifying attribute customer number

Comparison of basic terms

table Relational database Entity Relationship Model (ERM) Unified Modeling Language (UML)
Range of values ​​(domain, domain) Range of values ​​(domain, domain) Range of values ​​(domain, domain) Range of values ​​(domain, domain)
Header Relation type / relation format / relation scheme Entity type class
Column heading attribute attribute attribute
content relation Entity set Object set, instance set
- / - Foreign key relationship Relationship association
row Tuple entity Object , instance
cell Attribute value Attribute value Attribute value

Entity / object difference

The concept of the entity is related to the concept of the object in object-oriented programming. However, the terms have different meanings in their respective terminology, data modeling and object-oriented programming (OOP) . They essentially correspond to one another, but are neither identical nor synonymous:

  • An entity is merely a data -related construct that records / provides the specific values for the attributes and relationships specified in the respective entity type , e.g. B. “03/15/1994” as the “date of birth” of a specific customer. In simplified terms, an entity thus ultimately corresponds to a data record - whereby 'entities' are not only created for the purpose of software development , but e.g. B. can 'only' describe the terminology of a company.
  • In contrast, an OO object also knows a number of its own dynamic functions, operations and methods . That means: dynamic object type = programmatic representation of the entity type plus associated processing functions. Furthermore, the OOP methods often refer not only to entity types from a data model , but also, for example, to objects of user interfaces ( GUI ) as well as to the 'objects' occurring there in applications for word processing or computer games .

Both terms (entity and object) have one thing in common : They are - mostly within the framework of software development processes - identified, structured, derived into entity / object types and documented; the specifications are technically implemented in the computer programs by declarations and processing commands related to the data, and ultimately exist as the content of data stocks . The methodologically more detailed OOP modeling is not infrequently based on classic data modeling with its entities, attributes and relationships.

See also

Web links

Wiktionary: Entity  - explanations of meanings, word origins, synonyms, translations

Individual evidence

  1. ^ Peter Pin-Shan Chen: The Entity-Relationship Model-Toward a Unified View of Data. (PDF; 363 kB) Massachusetts Institute of Technology, March 1, 1976, accessed January 7, 2010 (definition of the Entity Relationship Model).