Browsed by
Author: Per Lilja

An introduction to Reactive Programming with RxJava – Part #3: Convert a traditional web application to a reactive one

An introduction to Reactive Programming with RxJava – Part #3: Convert a traditional web application to a reactive one

In my last two blog entries, I’ve given an introduction to reactive programming and RxJava. In this third and final part, I will show how you can convert a traditional web application to a reactive one. All the code will be available at https://gitlab.com/perlilja/rxAirlineDemo, there will also be the instructions on how to run the application. To get a full insight, I suggest you read the code. The final version is merged into the master branch, and the original version is…

Read More Read More

An introduction to Reactive Programming with RxJava – Part #2

An introduction to Reactive Programming with RxJava – Part #2

In my last blog entry, I gave a short introduction to reactive programming. In this part, I will provide a brief introduction to a reactive framework called RxJava. Yep, know I promised you some practical examples, and there will be some. However, I couldn’t fit everything in, which means it will be a part 3 as well.  RxJava is an implementation of the Reactive Extensions Library, for the JVM (Java Virtual Machine). It’s building on the Observable design pattern, which means…

Read More Read More

An introduction to Reactive Programming with RxJava – Part #1

An introduction to Reactive Programming with RxJava – Part #1

In the following two-part series I will explain the basics of Reactive Programming (pt. 1) and further give some practical examples by using the RxJava framework (pt. 2). Today’s system and applications have a growing demand on how to handle an increasing amount of data, a massive number of concurrent users, an up-time that should be almost 100% and at the same time have a quick and responsive system or UI. These changes have led to that a lot of…

Read More Read More

The importance of going deep

The importance of going deep

The term being a Stackoverflow-, copy&paste- or auto-complete-developer is nothing new. But even if this is frowned upon in our industry, we all do it. But there is a underlaying problem. Today there is a large focus on pushing out features, and time-to-market, not just leading to technical debt and bad code, it also just gives us developer only time to focus on the business logic. The pace of the information flow and the fear of being overrun by the…

Read More Read More

Terminal and Intermediate operations in the Java 8 Stream API

Terminal and Intermediate operations in the Java 8 Stream API

When working with the Stream API in Java 8, there are two groups of methods that you need to be aware of. These two groups are referred to as terminal and intermediate operators. Intermediate operators These are the methods in the Stream API that returns a new Stream, these are: distinct – Will only let through unique values, based on the objects equals method. filter – Takes a Predicate that should return true or false. True if the object should…

Read More Read More

Currying in Java 8

Currying in Java 8

In the new Java functional library, there are a set of interfaces for supporting Lambda expressions (the lambda expression is cast to appropriate interface). Example of these are Function and BiFunction, where the later takes two arguments and returns nothing. But what if we want to create a Lambda expression with more than two arguments? You can always create your own functional interface, that can take the number of arguments that you want. 1234public interface TriFunction<T, U, V, R> {…

Read More Read More

Method References in Java 8

Method References in Java 8

Method references is a way to pass a reference to a method, that can be invoked at a later stage, with Lambdas. The criteria to a method reference, as with all Lambda expressions, is that it can be assigned to a functional interface. There are 4 different kinds of method references: Reference to a static method When the reference is a static method in a class, for example String::valueOf in the example below. Note, System.out returns an Object, so System.out::println…

Read More Read More

Lambdas in Java 8

Lambdas in Java 8

Java 8 has been out for a while now, and there are a lot of great posts about all the new features, but I’m preparing an introduction for a team that just started to use Java 8, so I thought I could just as well publish my notes as a blog post. Lambdas are actual “just” another way of creating anonymous inner classes, in the pre Java 8 world, we had to write: 12345678JButton jButton = new JButton();    …

Read More Read More

A blowback

A blowback

Last year I started my company and what I though was going to be a great new journey in my life, but how wrong I was. But it thought me a lesson and started something I hope will be even greater. My developer career started in 2004, after I graduated from the university (Halmstad University) and I got my first full-time job as a database developer. I was one of the top students in my class,  and my passion and ambitiousness…

Read More Read More