Composition

When one class has another class in it and the dependent class can't exist without the super class, this is a composition relationship. For example, a bank account can't exist without a bank, as shown in the following diagram:

Get Hands-On Object-Oriented Programming with C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.