Expedia Group Technology — Engineering Exploring the strategy pattern and functional programming alternatives in Kotlin Photo by Karsten Winegeart on Unsplash When designing software around business processes (e.g., orchestration services), one of the key challenges is organizing business logic in a way that is maintainable, scalable, and adaptable to change. In this post, we’ll explore how to address such challenges…
#functional-programming
20 posts
2 Dec 2025
25 Apr 2023
5 Apr 2023
8 Jun 2021
Another List-Related Asymmetry A long time ago, I wrote an article about The Asymmetry of ++ , thanks to Fede Bergero ’s findings. Let’s add a few more asymmetries to that list… Bridge Symmetry (by Andy Beecroft ) Note: This article is based on OTP23. Many things have been improved since that version already. Introduction Initially, I thought about writing…
8 Feb 2021
So, @rotnroll666 nerd sniped me again. Apparently, the Neo4j Cypher query language supports arbitrary reductions, just like any functional collection API, oh say, the JDK Stream API: SQL doesn’t have this, yet it would be very useful to be able to occasionally do that. An arbitrary reduction can be implemented “easily” in SQL. Let’s look … Continue reading Implementing a…
23 Aug 2019
Particularly for Erlang Good Will Hunting (1997) So, I Gusti Ngurah Oka Prinarjaya was reading Joe’s Book and he found one of the most amazing examples of List Comprehensions I’ve ever seen… perms([]) -> [[]]; perms(List) -> [ [H|T] || H <- List, T <- perms(List--[H]) ]. Output: 1> lib_misc:perms("123"). ["123","132","213","231","312","321"] And, of course… he couldn’t understand it. And, as…
11 Feb 2019
jOOλ is our second most popular library. It implements a set of useful extensions to the JDK’s Stream API, which are useful especially when streams are sequential only, which according to our assumptions is how most people use streams in Java. Such extensions include: … and many more. Collectors But that’s not the only thing … Continue reading Lesser Known…
29 Oct 2018
I like weird, yet concise language constructs and API usages Yes. I am guilty. Evil? Don’t know. But guilty. I heavily use and abuse the java.lang.Boolean type to implement three valued logic in Java: I know – a lot of enterprise developers will bikeshed and cargo cult the old saying: Code is read more often … Continue reading Imperative Loop…
15 May 2018
27 Jul 2017
17 Mar 2017
With Java 8 lambdas being available to us as a programming tool, there is a “new” and elegant way of constructing objects. I put “new” in quotes, because it’s not new. It used to be called the strategy pattern, but as I’ve written on this blog before, many GoF patterns will no longer be implemented … Continue reading A Nice…
20 Dec 2016
Welcome to the jOOQ Tuesdays series. In this series, we’ll publish an article on the third Tuesday every other month where we interview someone we find exciting in our industry from a jOOQ perspective. This includes people who work with SQL, Java, Open Source, and a variety of other related topics. I’m very excited to … Continue reading jOOQ Tuesdays:…
4 Jul 2016
A recent article about various ways to implement structural pattern matching in Java has triggered my interest: http://blog.higher-order.com/blog/2009/08/21/structural-pattern-matching-in-java The article mentions a Scala example where a tree data structure can be traversed very easily and neatly using Scala’s match keyword, along with using algebraic data types (more specifically, a sum type): Even if you’re not … Continue reading How Functional…
17 Mar 2016
Too many programmers think SQL is a bit of a beast. It is one of the few declarative languages out there, and as such, behaves in an entirely different way from imperative, object-oriented, or even functional languages (although, some say that SQL is also somewhat functional). As a SQL trainer (do visit our training, it’s … Continue reading 10 Easy…
22 Oct 2015
Java 8 has lambdas and streams, but no tuples, which is a shame. This is why we have implemented tuples in jOOλ – Java 8’s missing parts. Tuples are really boring value type containers. Essentially, they’re just an enumeration of types like these: Writing tuple classes is a very boring task, and it’s best done … Continue reading The Danger…
17 Sept 2015
Mario Fusco’s popular tweet impressively shows what the main difference between imperative and functional approaches to similar algorithms really is: Imperative vs. Functional – Separation of Concerns pic.twitter.com/G2cC6iBkDJ — Mario Fusco 🇪🇺 (@mariofusco) March 1, 2015 Both algorithms do the same thing, they’re probably equally fast and reasonable. Yet, one of the algorithms is much … Continue reading Comparing Imperative…
26 Aug 2015
Much of the ORM criticism of the last decade missed the point, being inaccurate. By the end of this article, we will conclude with the following: There is no significant difference between the relational (data) model and object oriented models How to come to this conclusion? Read on! How we came to believe in this … Continue reading There is…
13 May 2015
We’re very happy to announce a guest post on the jOOQ Blog written by Daniel Dietrich, Senior Software Engineer at HSH Nordbank, husband and father of three. He currently creates a pricing framework for financial products as project lead and lead developer. Besides his work, he is interested in programming languages, efficient algorithms and data … Continue reading Functional Programming…
10 Sept 2014
Java 8 was – as always – a release of compromises and backwards-compatibility. A release where the JSR-335 expert group might not have agreed upon scope or feasibility of certain features with some of the audience. See some concrete explanations by Brian Goetz about why … … “final” is not allowed in Java 8 default … Continue reading When the…
11 Jul 2014
In the past, we’ve been providing you with a new article every Friday about what’s new in Java 8. It has been a very exciting blog series, but we would like to focus again more on our core content, which is Java and SQL. We will still be occasionally blogging about Java 8, but no … Continue reading Java 8…