上QQ阅读APP看书,第一时间看更新
Portability
Portability, also referred to as modularity, is the primary benefit of OOP. With OOP, we program in a series of classes. For example, we would have a bicycle class and other classes for a complete bicycle management system. If there was a problem with a bicycle method, we immediately know to check the bicycle class. That makes source code troubleshooting efficient.
The class structure lends itself well to portability. Our example bicycle class can easily be used in other programs as it is a self-contained object. As mentioned previously, the class contains all the components of a physical bicycle.