HATEOAS for a Spring REST Service 1. Overview This article will focus on the implementation of discoverability in a Spring REST Service and on satisfying the HATEOAS constraint. 2. Decoupling Discoverability Through Events Discoverability as a separate aspect or concern of the web layer should be decoupled from the controller… Continue Reading rest-api-discoverability-with-spring

Apache Commons Collections OrderedMap 1. Overview The Apache Commons Collections library provides useful classes that complement the Java Collections Framework. In this article, we will review the interface OrderedMap, which extends java.util.Map. 2. Maven Dependency The first thing we need to do is to add the Maven dependency in our… Continue Reading apache-commons-ordered-map

Pass-By-Value as a Parameter Passing Mechanism in Java   1. Introduction The two most prevalent modes of passing arguments to methods are “passing-by-value” and “passing-by-reference”. Different programming languages use these concepts in different ways. As far as Java is concerned, everything is strictly Pass-by-Value. In this tutorial, we’re going to illustrate… Continue Reading java-pass-by-value-or-pass-by-reference

Removing Repeated Characters from a String 1. Overview In this tutorial, we’ll discuss several techniques in Java on how to remove repeated characters from a string. For each technique, we’ll also talk briefly about its time and space complexity. 2. Using distinct Let’s start by removing the duplicates from our… Continue Reading java-remove-repeated-char

Monte Carlo Tree Search for Tic-Tac-Toe Game 1. Overview In this article, we’re going to explore the Monte Carlo Tree Search (MCTS) algorithm and its applications. We’ll look at its phases in detail by implementing the game of Tic-Tac-Toe in Java. We’ll design a general solution which could be used… Continue Reading java-monte-carlo-tree-search

Hamcrest File Matchers 1. Overview In this tutorial, we’ll discuss Hamcrest File Matchers. We discussed Hamcrest Matchers in general before in the previous Testing with Hamcrest article. In the next sections, we’ll focus only File Matchers. 2. Maven Configuration First, we need to add the following dependency to our pom.xml:… Continue Reading hamcrest-file-matchers

Spring, Hibernate and a JNDI Datasource 1. Overview In this article, we’ll create a Spring application using Hibernate/JPA with a JNDI datasource. If you want to rediscover the basics of Spring and Hibernate, check out this article. 2. Declaring the Datasource ==== 2.1. System Since we’re using a JNDI datasource,… Continue Reading spring-persistence-jpa-jndi-datasource