Monthly Archives: January 2023

Java’s functional Consumer interface

Quite often, a Java Stream or other component needs an object passed thereto to perform some form of calculation or process, but when the method is complete, nothing returns from the tactic. this is often where Java’s functional Consumer interface comes in handy. According to JavaDoc, the patron interface accepts any object style as input. Continue Reading »

Depth First Search (DFS) – Graph Traversal

Table of contents Definition Conceptual Implementation Java Code & Explanation Applications of DFS   Definition Depth First Search (DFS) is an algorithm for traversing Graph Data Structure. The algorithm starts at some arbitrary node in the graph and explores as far as possible along each branch before backtracking. Stack Data structure is needed to keep Continue Reading »

Derived Query Methods of Spring Data JPA

Use Derived Query Methods of Spring Data JPA Repositories instead of writing your own queries. For the simple jpa queries, we generally use @Query annotation to make the queries, but the best practice says that we should use Derived Query Methods instead. Most developers hardly use one or two derived query methods like findById, and Continue Reading »