encyclopegia.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.[src] In simple words, has-a relationship in an object is called a member field of an object.[src] Multiple has-a relationships will combine to form a possessive hierarchy.[src]

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.[src] In simple words, has-a relationship in an object is called a member field of an object.[src] Multiple has-a relationships will combine to form a possessive hierarchy.[src] ==Related concepts== "Has-a" is to be contrasted with an is-a (is_a or is a) relationship which constitutes a taxonomic hierarchy (subtyping).[src] The decision whether the most logical relationship for an object and its subordinate is not always clearly has-a or is-a.[src] Confusion over such decisions have necessitated the creation of these metalinguistic terms.[src] A good example of the has-a relationship is containers in the C++ STL.[src] 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.[src] without ownership) relation: a holonym (whole) has a has-a relationship with its meronym (part), for a composition (i.e.[src] 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).[src] ==Examples== ==See also== Object composition Has-a Holonymy Meronymy Is-a Hypernymy (and supertype) Hyponymy (and subtype) ==Notes==[src]

14 sentences · 14 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Has-a." encyclopegia.org, 2025, https://encyclopegia.org/wiki/has-a. Accessed 26 November 2026.

Chicago

"Has-a." encyclopegia.org. Accessed November 26, 2026. https://encyclopegia.org/wiki/has-a.

APA

encyclopegia.org. (2025). Has-a. Retrieved November 26, 2026, from https://encyclopegia.org/wiki/has-a

Accessed November 26, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1273210121 · 0.5 · snapshot enwiki-001273210121

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.