<s>
In	O
database	B-General_Concept
design	I-General_Concept
,	O
object-oriented	B-Language
programming	I-Language
and	O
design	B-Application
(	O
see	O
object	B-Language
oriented	I-Language
program	B-Architecture
architecture	I-Architecture
)	O
,	O
has-a	B-Application
(	O
has_a	O
or	O
has	O
a	O
)	O
is	O
a	O
composition	B-Language
relationship	O
where	O
one	O
object	O
(	O
often	O
called	O
the	O
constituted	O
object	O
,	O
or	O
part/constituent/member	O
object	O
)	O
"	O
belongs	O
to	O
"	O
(	O
is	O
part	B-Language
or	I-Language
member	I-Language
of	I-Language
)	O
another	O
object	O
(	O
called	O
the	O
composite	O
type	O
)	O
,	O
and	O
behaves	O
according	O
to	O
the	O
rules	O
of	O
ownership	O
.	O
</s>
<s>
In	O
simple	O
words	O
,	O
has-a	B-Application
relationship	O
in	O
an	O
object	O
is	O
called	O
a	O
member	O
field	O
of	O
an	O
object	O
.	O
</s>
<s>
Multiple	O
has-a	B-Application
relationships	O
will	O
combine	O
to	O
form	O
a	O
possessive	O
hierarchy	O
.	O
</s>
<s>
The	O
decision	O
whether	O
the	O
most	O
logical	O
relationship	O
for	O
an	O
object	O
and	O
its	O
subordinate	O
is	O
not	O
always	O
clearly	O
has-a	B-Application
or	O
is-a	O
.	O
</s>
<s>
A	O
good	O
example	O
of	O
the	O
has-a	B-Application
relationship	O
is	O
containers	B-Application
in	O
the	O
C++	B-Application
STL	I-Application
.	O
</s>
<s>
for	O
an	O
inheritance	B-Language
relation	O
:	O
a	O
hyponym	O
(	O
subtype	O
,	O
subclass	O
)	O
has	O
a	O
type-of	O
(	O
is-a	O
)	O
relationship	O
with	O
its	O
hypernym	O
(	O
supertype	O
,	O
superclass	O
)	O
;	O
</s>
<s>
a	O
holonym	O
(	O
whole	O
)	O
has	O
a	O
has-a	B-Application
relationship	O
with	O
its	O
meronym	O
(	O
part	O
)	O
,	O
</s>
<s>
for	O
a	O
composition	B-Language
(	O
i.e.	O
</s>
<s>
a	O
meronym	O
(	O
member	O
)	O
has	O
a	O
member-of	O
relationship	O
with	O
its	O
holonym	O
(	O
container	B-Application
)	O
;	O
</s>
<s>
In	O
databases	O
has-a	B-Application
relationships	O
are	O
usually	O
represented	O
in	O
an	O
Entity	B-Architecture
–	I-Architecture
relationship	I-Architecture
model	I-Architecture
.	O
</s>
<s>
This	O
shows	O
that	O
account	O
has	O
a	O
"	O
has-a	B-Application
"	O
relationship	O
with	O
character	O
.	O
</s>
<s>
In	O
object-oriented	B-Language
programming	I-Language
this	O
relationship	O
can	O
be	O
represented	O
with	O
a	O
Unified	O
Modeling	O
Language	O
Class	O
diagram	O
.	O
</s>
<s>
This	O
has-a	B-Application
relationship	O
is	O
also	O
known	O
as	O
composition	B-Language
.	O
</s>
<s>
As	O
you	O
can	O
see	O
from	O
the	O
Class	O
Diagram	O
on	O
the	O
right	O
a	O
car	O
"	O
has-a	B-Application
"	O
carburetor	O
,	O
or	O
a	O
car	O
is	O
"	O
composed	O
of	O
"	O
a	O
carburetor	O
.	O
</s>
<s>
When	O
the	O
diamond	O
is	O
coloured	O
black	O
it	O
signifies	O
composition	B-Language
,	O
i.e.	O
</s>
<s>
Another	O
way	O
to	O
distinguish	O
between	O
composition	B-Language
and	O
aggregation	O
in	O
modeling	O
the	O
real	O
world	O
,	O
is	O
to	O
consider	O
the	O
relative	O
lifetime	O
of	O
the	O
contained	O
object	O
.	O
</s>
<s>
It	O
will	O
have	O
the	O
same	O
lifetime	O
as	O
the	O
car	O
itself	O
;	O
so	O
the	O
relationship	O
is	O
one	O
of	O
composition	B-Language
.	O
</s>
<s>
If	O
one	O
were	O
to	O
make	O
a	O
C++	B-Language
software	O
Class	O
to	O
implement	O
the	O
relationships	O
described	O
above	O
,	O
the	O
Car	O
object	O
would	O
contain	O
a	O
complete	O
Chassis	O
object	O
in	O
a	O
data	O
member	O
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
the	O
Car	O
class	O
data	O
members	O
that	O
point	O
to	O
Tire	O
objects	O
would	O
most	O
likely	O
be	O
C++	B-Language
pointers	O
.	O
</s>
