New #Fortran post: Service Composition, part 2: Decoration https://matthiasnoback.nl/2025/06/fortran-service-composition-decoration/
In this post we explore another way of composing abstractions, which is called decoration. We prefix existing log messages with a timestamp and implement optional delegation based on a configured log level.

Fortran: Service Composition, part 2: Decoration
In the previous post we saw how to use an abstraction to compose an aggregation of services of that same abstraction. There we simply delegated a call, adding no specific behavior. But we might as well add some new behavior before or after delegating the call. As an example, let’s try to implement a new feature in the logging module: we want to add a timestamp in front of each message, so the output becomes something like this: