Skip to content
EntityQ1985787· pop 8· linked from 13 articles

Also known as 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.

Wikidata facts

Image
ER Diagram MMORPG.svg
Sources (1)

via Wikidata · CC0

~5 min read

Article

7 sections
Contents
  • Related concepts
  • Examples
  • Entity–relationship model
  • UML class diagram
  • C++
  • See also
  • Notes

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).

Available in 8 languages

via Wikidata sitelinks · CC0

Connections

Categories