Objects within Objects

Hierarchies are one way to establish relationships between objects. However, there are other methods by which objects relate and express real-life scenarios. One very common way to relate objects is by having objects within objects.

A more common term for the “object within object” concept is encapsulation. Effective use of encapsulation reduces complexity by exposing only the amount of detail necessary to understand an object. For instance, the aerial capabilities of birds may be extremely fascinating. Biologists may study wings, feathers, and bone structures for a deeper understanding. On the other hand, there may not be much interest in studying a digestive system. Therefore, a biologist may not have the desire to examine ...

Get C# Unleashed 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.