|
|
OO - Benefits |
|
Encapsulation of data limits the effects of changes. People using the code don't care how I add the elements of a Matrix - just that I do.
OO facilitates the reusing of code. For example, the algorithm to add two Vectors and two Matrices is the same. Subclassing gives the ability to do this safely and easily.
OO models many real world problems in a way that allows the code to resemble the problem it's modeling. In many instances this allows the programmer to speak in the same 'language' as the domain experts.
OO provides a natural grouping of methods and data making the layout of the software easier to grasp.
OO facilitates easy unit testing.