Intro to OAuth and OpenID Connect – Part 1

OAuth 2.0 and OpenID Connect are becoming the de-facto standard for handling authentication and authorization in modern applications. This post is the starting point of a series of posts covering OAuth 2.0 and OpenID Connect (OIDC). It introduces you to OAuth and OIDC and tells you why you’ll want to leverage these mechanisms when dealing […]


Test Slices in Spring-Boot

One of the early mistakes that I’ve done in my first professional Spring-Boot based project was writing integration tests that load the entire ApplicationContext using @SpringBootTest annotation when there’s no need. Thankfully, one of my colleagues was kind enough to help me understand that there is a better way to do things 🙂 Writting tests […]

Twelve-Factor Application: Configuration in Spring

The Twelve-Factor application methodology is a collection of best practices that are designed to enable applications to be developed with portability and resilience when deployed. In this post, we’ll cover the third factor, Config. We’ll also see how the spring ecosystem contributes to helping developers achieve this factor. The Twelve-Factor application manifesto advocates on externalizing […]

Core Java: Date and Time

Since Java 8, Oracle completely rebuilt its Date/Time API. The new API is supposed to replace the old one. The new API which is located in the java.time package is thread-safe because most of the new classes are immutable, meaning that, after the object is constructed, it cannot be modified. This is especially useful when […]

Java Generics: Type Erasure & Wildcards

Specifying the generic type allows Java to perform type checking at compile-time. But when using generics in your code, due to “Type Erasure” that occurs at compile-time, generic type parameters are converted to the Object type. This makes generic type parameters unable to call other methods except for the Object ones. What if we want […]

Concurrency: Thread Safety In Java

What is Thread safety? To save you the time from looking up to Wikipedia here is the definition: Thread safety is a computer programming concept applicable to multi-threaded code. Thread-safe code only manipulates shared data structures in a manner that ensures that all threads behave properly and fulfill their design specifications without unintended interaction. What […]

Core Java: Comparator vs. Comparable

When working with custom objects, we often want to compare them based on some pre-defined criteria. That’s why we use the Comparable interface to implement a natural ordering for our custom objects. Also, we often need to specify a total ordering if there is no natural ordering implemented by our custom object or override the […]