Building an extensible architecture

Photo by 贝莉儿 NG on Unsplash

TL;DR

Subtype polymorphism is great for adding more entity types. Pattern matching is a better choice for adding more functionality. In many use cases, it’s likelier that more functionality is requested than that more entity types are requested.

Disclaimer

When use the term pattern matching, I’m referring to a limited subset. …


Foto von Lukas von Pexels

An introduction to Optional.flatMap

TL;DR

null is bad for representing the absence of a value, use Optionals instead. Use Optional.flatMap to chain multiple operations that might not return a value.

The problem with null

Let’s quickly recap what nullis and what problem it entails.

Fabian Böller

I’m a senior software engineer working in Bonn at LeanIX. I write about software development best practices across multiple programming languages.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store