Functional Software Architecture

Everything as a Value

A Functional Software Architecture Principle

Every software is _about_ something: A simple calculator application is about numbers and operations thereon, an anomaly detection application is about time series, an operating system is about system resources. Applications are usually split into different components. One component may be about something else than another component inside the same application. In an anomaly detection application, the visualization component may be about charts and graphs, whereas the storage module may be about SQL queries.

In any of these cases where a piece of software is about a concept, we have a choice of either blindly programming around the concept or making the concept an explicit part of our programming model.For example the aforementioned visualization component could take in byte arrays and draw pixels on the screen, without ever mentioning the concept of a graph in the code. Or it could make the concept of a graph an explicit part of its language. The component may still need to accept byte arrays as input, but it could translate these byte arrays into its idea of time series, then turn these time series into graphs and then render these graphs as pixels on screen. In Functional Software Architecture we strongly favor the latter approach. The technique of turning formerly implicit concepts into explicit devices of the software is often called 'reification' or 'internalizing' or we say that we make the concept 'first-class'.

Successful Examples of Reification

Some of the most profound advances in software engineering are due to internalizing formerly vague and implicit concepts.

Functions as first-class procedures

On of the first linguistic devices in programming were procedural abstractions. A procedure is a snippet of code that is written down once and can be called from many different places with different parameters. Functional programming improved on this primitive notion by making procedures first-class values: Procedures could now not just be named and invokes but also passed around to other procedures (making these procedures 'higher-order') just like integers, characters, lists, etc.

Functions as first-class values allows for more expressive and modular, and therefore reusable code.

Jolie: Services as first-class values

In the Jolie programming language, you compose small services to form larger services. In the words of the language maintainers:

Jolie crystallises the programming concepts of service-oriented computing as linguistic constructs. The basic building blocks of software are not objects or functions, but rather services that can be relocated and replicated as needed. A composition of services is a service.