Is A and Has A Concepts in Object-Oriented Design episode artwork

EPISODE · Mar 12, 2021 · 15 MIN

Is A and Has A Concepts in Object-Oriented Design

from Develpreneur: Become a Better Developer and Entrepreneur · host Rob Broadhead

The ideas of "is a" and "has a" are often discussed as part of object-oriented design.  These concepts may seem simple and obvious.  However, they can often be confused, and complex systems can blur the lines between them.  We start a multi-part episode going over these concepts focused on how "is a" relationships work. Is A and Has A Defined These concepts boil down to simple grammar.  For two objects, A and B, here are the options. A is a B if A has all of the traits of B.  For example, a poodle is a dog because a poodle has the traits we equate to a dog.  A dog is not a poodle, as some dogs have traits that are not shared with a poodle. A has a B when the entirety of B exists within A.  A dog has a tail.  The tail does not exist on its own away from the dog.  More simply, a car has a color.  In these relationships, multiple things can have the B part of the relationship. One Way Relationships For our purposes, these are one-way relationships.  When A is a B, B is not an A.  Likewise, when A has a B, B does not have an A.  The color does not have a car; the tail does not have a dog.  These definitions can seem to break when we replace names with instances.  A father can have a son, and a son can have a father, but that is not a definition of contained properties.  This example would be a relationship or pointers and not attributes that are contained.  You have a height no matter what.  You may not have a father if he passes away or something like that.  As you can see already, grammar can confuse the situation, so we will continue to dig into these concepts and applying them.

NOW PLAYING

Is A and Has A Concepts in Object-Oriented Design

0:00 15:38

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

Frequently Asked Questions

How long is this episode of Develpreneur: Become a Better Developer and Entrepreneur?

This episode is 15 minutes long.

When was this Develpreneur: Become a Better Developer and Entrepreneur episode published?

This episode was published on March 12, 2021.

What is this episode about?

The ideas of "is a" and "has a" are often discussed as part of object-oriented design.  These concepts may seem simple and obvious.  However, they can often be confused, and complex systems can blur the lines between them.  We start a multi-part...

Can I download this Develpreneur: Become a Better Developer and Entrepreneur episode?

Yes, you can download this episode by clicking the download button on the episode player, or subscribe to the podcast in your preferred podcast app for automatic downloads.
URL copied to clipboard!