g ∘ f patterns by Mario Fusco
The book of design patterns known as Gang of Four has been a kind of Bible for all the developers of my generation. Its main pro has been giving us a common vocabulary: when a programmer says "here I used a strategy pattern" all colleagues know of what he is speaking about. Nevertheless the biggest issue with this is that almost all patterns listed in that book, especially the behavioural ones, are a only workaround for a missing abstraction: higher order functions. The introduction of lambda expressions in Java 8 finally allows all Java developers to remove this no longer necessary and cumbersome object oriented infrastructure from their code. The purpose of this talk is showing, through a series of live coding examples, how the most common GoF patterns can be rethought and reimplemented in a simpler and more concise functional way leveraging Java 8 lambdas. Mario Fusco is a senior software engineer at Red Hat working at the development of the core of Drools, the JBoss rule engine. He has a huge experience as Java developer having been involved in (and often leading) many enterprise level projects in several industries ranging from media companies to the financial sector. Among his interests there are also functional programming and Domain Specific Languages. By leveraging these 2 passions he created the open source library lambdaj with the purposes of providing an internal Java DSL for manipulating collections and allowing a bit of functional programming in Java. He is also a Java Champion and the co-author of "Java 8 in Action" published by Manning. [MLS-6332]