This is part 6 of the series called “Functional Java by Example”. The example I’m evolving in each part of the series is some kind of “feed handler” which processes documents. In previous part we tried to make our functions as pure possible by moving as much of the side-effects, such as IO, to the outside of the system. Now … Lees verder Functional Java by Example | Part 6 – Functions as Parameters

This is part 4 of the series called “Functional Java by Example”. In previous part we talked a bit about side effects and I’d like to elaborate a bit more about how we can prevent having our data manipulated in unexpected ways by introducing immutability into our code.

Today is my birthday. Yes, it is actually my birthday: May the 15th. So, I thought it would be fun to write about a little algorithmic puzzle I’ve been pondering about. You see, each year we grow older; as a person, but also collectively as an organisation, a group, a community. That’s a lot of combined knowledge I reckon. 🙂 … Lees verder Creative Ways of Finding a Birthday: When Are We 250 Years?

This is part 3 of the series called “Functional Java by Example” and is a cross-post from my personal blog. The example I’m evolving in each part of the series is some kind of “feed handler” which processes documents. In previous parts I started with some original code and applied some refactorings to describe “what” instead of “how”. In order … Lees verder Functional Java by Example | Part 3 – Don’t Use Exceptions to Control Flow

This is part 2 of the series called “Functional Java by Example”. The example I’m evolving in each part of the series is some kind of “feed handler” which processes documents. In previous part I started with some original code and applied some refactorings to describe “what” instead of “how”. In order to help the code going forward, we need … Lees verder Functional Java by Example | Part 2 – Tell a Story

Functional Programming (FP) is about avoiding reassigning variables, avoiding mutable data structures, avoiding state and favoring functions all-the-way. What can we learn from FP if we would apply functional techniques to our everyday Java code? In this series called “Functional Java by Example” I will refactor in 8 installments an existing piece of code to see if I can reach … Lees verder Functional Java by Example | Part 1 – From Imperative to Declarative

The context Grails makes it very easy to put any logic of your application in a service. Just grails create-service and you’re good to go. There’s a single instance by default, injectable anywhere. Powerful stuff and makes it easy to get up ’n running very fast! Creating a new application, following so-called “best practices” from blogs like these 🙂 and … Lees verder Grails Anti-Pattern: Everything is a Service

The context Grails makes it very easy to persist and find stuff using domain classes. It uses GORM (Grails’ Object Relational Mapping) under the hood, which by default uses Hibernate to map domain classes to tables in a database. Powerful stuff and makes it easy to get up ’n running very fast! Creating a new application, following so-called “best practices” … Lees verder Grails Anti-Pattern: Locally Optimized Dynamic Finders Everywhere