Chapter 13. Software Architecture: Object-Oriented Versus Functional

Bertrand Meyer

One of the arguments for functional programming is better modular design.By analyzing publications advocating this approach, in particular through the example of a framework for financial contracts, we access its strengths and weaknesses, and compare it with object-oriented design. The overall conclusion is that object-oriented design, especially in a modern form supporting high-level routine objects or “agents,” subsumes the functional approach, retaining its benefits while providing higher-level abstractions more supportive of extension and reuse.

Overview

“Beauty,” as a slogan for a software architecture, is not strictly for the beholder to judge. Clear objective criteria exist (Meyer 1997):

Reliability

Does the architecture help establish the correctness and robustness of the software?

Extendibility

How easy is it to accommodate changes?

Reusability

Is the solution general, or better yet, can we turn it into a component to be plugged in directly, off-the-shelf, into a new application?

The success of object technology has largely followed from the marked improvements it brings—if applied properly as a method, not just through the use of an object-oriented programming language—to the reliability, extendibility, and reusability of the resulting programs.

The functional programming approach predates object-oriented thinking, going back to the Lisp language available for almost 50 years. To those fortunate enough ...

Get Beautiful Architecture 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.