Component Interfaces
Interaction with objects requires some stimulus to invoke their behavior. In an inheritance hierarchy, the interaction is similar as you move down the hierarchy. For example, if there was an electrical appliance hierarchy, it could have child objects of clock, radio, and microwave. Each of these objects has the behavior of running on electrical power. Therefore, this behavior could be invoked by a power connection.
The run-through-power-connection behavior is expected behavior that is relied upon to accomplish the task we need done in the most efficient manner. If one of these objects operated in another way, it would lead the operator to be confused or believe something was wrong. Common behavior helps tasks be performed ...
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.