Encapulation and Interchangeability

An important aspect of the division into parts is to clearly characterizes the connection, or interface, between the different components. By doing this, it allows for the consideration of multiple different implementations of the same interface. For example, a car can have different different types of engine and a single transmission. This is possible because the different engines, while have different performance characteristics, satisfy the same interface as far as the transmission is concerned.

In software, we follow the same principle. We try to characterize a component by an interface that is independent of the implementation. This allows us to easily slip different implementations in with minimal impact on the other parts of a system.

[audio] [real] Text to accompany slide17, in Chapter 2 of An Introduction to Object-Oriented Programming