e01.org

Has-a

In database design, object-oriented programming and design, has-a (has_a or has a) is a composition relationship where one object (often called the constituted object, or part/constituent/member object) "belongs to" (is part or member of) another object (called the composite type), and behaves according to the rules of ownership. In simple words, has-a relationship in an object is called a member field of an object. Multiple has-a relationships will combine to form a possessive hierarchy. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

In database design, object-oriented programming and design, has-a (has_a or has a) is a composition relationship where one object (often called the constituted object, or part/constituent/member object) "belongs to" (is part or member of) another object (called the composite type), and behaves according to the rules of ownership. In simple words, has-a relationship in an object is called a member field of an object. Multiple has-a relationships will combine to form a possessive hierarchy. ==Related concepts== "Has-a" is to be contrasted with an is-a (is_a or is a) relationship which constitutes a taxonomic hierarchy (subtyping). The decision whether the most logical relationship for an object and its subordinate is not always clearly has-a or is-a. Confusion over such decisions have necessitated the creation of these metalinguistic terms. A good example of the has-a relationship is containers in the C++ STL. To summarize the relations, we have hypernym-hyponym (supertype-subtype) relations between types (classes) defining a taxonomic hierarchy, where for an inheritance relation: a hyponym (subtype, subclass) has a type-of (is-a) relationship with its hypernym (supertype, superclass); holonym-meronym (whole/entity/container-part/constituent/member) relations between types (classes) defining a possessive hierarchy, where for an aggregation (i.e. without ownership) relation: a holonym (whole) has a has-a relationship with its meronym (part), for a composition (i.e. with ownership) relation: a meronym (constituent) has a part-of relationship with its holonym (entity), for a containment relation: a meronym (member) has a member-of relationship with its holonym (container); concept-object (type-token) relations between types (classes) and objects (instances), where a token (object) has an instance-of relationship with its type (class). ==Examples== ==See also== Object composition Has-a Holonymy Meronymy Is-a Hypernymy (and supertype) Hyponymy (and subtype) ==Notes==

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Has-a". 1738394237. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1273210121

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·