Practical Guide to Java 8’s Date Time API

I will be covering the features of the Java 8’s Date Time API from a practical standpoint, which means those features that a developer uses on a daily basis. This API was introduced as part of the JSR-310. In addition to improvements over existing Date and Calendar in representing date... [Read More]

How functional programming helps me write clean code

I have been writing code for several years now. One thing that I have realized is that I have spent much more time in reading code than writing code. Hence, as a part of continuous improvement, I invest a lot of time in learning new techniques to write clean code.... [Read More]

Using asynchrony to reduce response times in Java 8

Java 8, among other changes, had introduced CompletableFuture which has made writing asynchronous programs in Java easy. In this article I will be using CompletableFuture to explain how asynchronous programs are written and what value asynchronous programs bring in the context of backend services’ response times. I will also be... [Read More]

Java 8 Optional as a Monad

Lately there has been lot of discussions around functional programming and object oriented programming and their differences. A few functional programming constructs had also been introduced in Java 8 release a couple of years back. Since then I have been exploring functional programming and I have realized that using a... [Read More]

REST Error Responses in Spring Boot

The format of error responses from REST web services has always been a topic of grey area for me. According to me, whatever format you choose, it should give enough information to the clients, consuming the REST web services, so that the clients can handle the error situations gracefully. Spring... [Read More]

Writing Comparators - The Java 8 Way

Java 8 introduced a few default methods and static factory methods on the Comparator interface using which developers can write Comparators in a declarative way. The Comparator interface combines the principles from Builder Pattern, Factory Method Pattern, Decorator Pattern and Functional Programming to come up with a very expressive API.... [Read More]

RxJava - Part 3 - Multithreading

RxJava makes it easy to write asynchronous and concurrent applications. To be able to do that you will have to write programs that get executed on multiple threads. In this article I will show how RxJava helps in writing multithreaded programs using Scheduler and Observable’s subscribeOn() and observeOn() methods. [Read More]

RxJava - Part 2 - Creating an Observable

An Observable is the heart of RxJava. It is the source of data or events in Reactive Programming. RxJava provides many methods in its library to create an Observable. Choosing which one to use can be difficult. My goal from this article is to help you in making this choice... [Read More]