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.

Featured Partners

From learning to earning

Jobs that call for the skills explored in this talk.

Back Java Legacy

Babel
Municipality of Madrid, Spain

Remote
Java
DevOps
Docker
Openshift
+3

Java Developer


Charing Cross, United Kingdom

104K
iOS
Java
REST
Redshift
+5