Dan Lebrero

Java with a Clojure mindset

What if your business logic returned data instead of performing I/O? See how a Clojure mindset can radically simplify your Java architecture.

Java with a Clojure mindset
#1about 4 minutes

Applying an alien Clojure mindset to a Java application

A real-world betting bonus application is used as an example to explore how functional principles from Clojure can improve Java code.

#2about 3 minutes

The core concept of pure functions versus side effects

Pure functions, which always return the same output for a given input, are easier to understand and change than code with unpredictable side effects.

#3about 10 minutes

Managing application state using immutability and atoms

Separate business logic from state management by using immutable data structures and a central atomic reference to handle concurrent updates safely.

#4about 8 minutes

Decoupling the decision and execution of side effects

Instead of executing side effects directly, pure functions should return data structures that describe the effects to be performed by an external execution layer.

#5about 3 minutes

Managing input co-effects with Kafka and event sourcing

Use an event stream like Kafka as the source of truth to rebuild application state in memory, eliminating the need for database reads in the core logic.

#6about 1 minute

Designing with a functional core and imperative shell

Isolate pure business logic in a 'functional core' and handle all interactions with the outside world in a thin 'imperative shell'.

#7about 4 minutes

The benefits of data-oriented programming over custom types

Representing domain models as generic data structures like maps and lists allows for greater code reuse from core libraries and third-party tools.

#8about 2 minutes

Achieving a tight feedback loop with a dynamic REPL

A REPL (Read-Eval-Print Loop) enables modifying and inspecting a live application without restarts, creating an interactive and highly efficient development workflow.

#9about 4 minutes

Why Lisp's 'code is data' philosophy is powerful

In Lisp-family languages like Clojure, code is represented by the language's own data structures, which makes metaprogramming incredibly natural and powerful.

#10about 2 minutes

Final thoughts on learning from alien programming languages

Embracing languages with different paradigms, like Clojure, can fundamentally change how you think about and design software in any language.

Related jobs
Jobs that call for the skills explored in this talk.

d

Saby Company
Delebio, Italy

Junior

asasd

Expire

Remote
Junior

test

Milly
Vienna, Austria

Intermediate

Featured Partners

Related Articles

View all articles
BB
Benedikt Bischof
Using Java 17 latest features in real world projects
Welcome to this issue of the WeAreDevelopers Live Talk series. This article recaps an interesting talk by Ron Veen who introduced the audience to some of the most interesting features that got added to the Java language.About the speaker:Ron is a hig...
Using Java 17 latest features in real world projects
BB
Benedikt Bischof
Java Basics
In 1991,James Gosling invented a high-level, general-purpose, object-oriented andsecure programming language and called it OAK (after a tree in front of hiswindow). And four years later, in 1995, it was renamed after one of the GreaterSunda Islands: ...
Java Basics
CH
Chris Heilmann
WeAreDevelopers LIVE days are changing - get ready to take part
Starting with this week's Web Dev Day edition of WeAreDevelopers LIVE Days, we changed the the way we run these online conferences. The main differences are:Shorter talks (half an hour tops)More interaction in Q&AA tips and tricks "Did you know" sect...
WeAreDevelopers LIVE days are changing - get ready to take part

From learning to earning

Jobs that call for the skills explored in this talk.