9

Object-Oriented Programming

In the preceding chapter, we saw that the OO style of programming is strongly related to data types and the cohesion of data. But that’s not all there is to object orientation. Indeed, data cohesion may be secondary to another attribute of object orientation: polymorphism.

In Clean Architecture,1 I made the point that the OO style has three attributes: encapsulation, inheritance, and polymorphism. I then led you through the reasoning that, of the three, polymorphism is the most beneficial. The other two are, at best, ancillary.

1. Robert C. Martin, Clean Architecture (Pearson, 2017).

The examples in the previous ...

Get Functional Design: Principles, Patterns, and Practices 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.