|
|
|
|
|
by tcgv
1598 days ago
|
|
I always bring up this paper when I read a post criticizing OOP. It's a bit old but still very relevant and practical. In it the concept of information hiding, closely related to encapsulation, was first described. This concept plays a central role in the strategy for effective system modularization and is IMHO the basis of OOP. Shameless plug: A couple of years ago I wrote a post about this paper trying to expand it based on my personal experience and providing a more simpler example to elucidate the concepts presented in it [1] [1] https://thomasvilhena.com/2020/03/a-strategy-for-effective-s... |
|
Languages like Ada and Ocaml have object orientation extensions to the initial languages (Ada 83, and Caml/SML) that can very often be ignored. And still are very good for encapsulation. With them, modules (packages for Ada) and types are separate. It is very natural to group close types together into one module, while exporting opaque abstract types only usable through a module services.
Rolling different concepts into the class may give a more intuitive result at first, particularly when simulating real world entities. But it's also a bit limiting compared to keeping those concepts orthogonal.