# Today I Learned

Some of the things I've learned every day since Oct 10, 2016

## 110: Combining Has-a and Is-a (Pseudo-Transitivity)

There’s a property of the interaction between the has-a and is-a relations when they are over the same set, which is somewhat similar in form — superficially, at least — to the property of transitivity. Recall that the property of transitivity says of a relation $\rightarrow$ that if $a \rightarrow b$ and $b \rightarrow c$, then $a \rightarrow c$.

Now denote is-a as $\rightarrow$ and has-a as $\dashrightarrow$. Then this property of interaction between the two relations, which I don’t know of a name for, states

1. If $a \rightarrow b$ and $b \dashrightarrow c$, then $a \dashrightarrow c$.
2. If $a \dashrightarrow b$ and $b \rightarrow c$, then $a \dashrightarrow c$.

If you interpret what this means in plain English then the truth of this property is evident. The problem is I’ve never come across formal systems for allowing these sorts of interactions between relations, so I’m not sure if it’s something that’s already been developed. Will be looking into it more.

## 109: Composition vs Aggregation in Has-a Relationships

There are two different types of has-a relationships, composition and aggregation, distinguished by whether the child object belonging to the parent object can belong to more than just that parent. In essence, composition implies ownership while aggregation does not.

For example, a university has departments. These departments belong to no other university and if the university is ceases to exist, so do they. This exemplifies a composition relation.

By contrast, a department has professors, but a given professor may belong to more than one department and will usually not cease to exist when the department does. This is instead an aggregation relation.