Chain of Responsibility Design Pattern

This is kind of Behavioral Design Pattern(BDP) and as per the BDP definition, “Behavioral patterns describe how the objects behave when they interact with each other“. So this design pattern is used when the job is done in pieces and those pieces interact with each other at run time. E.g.  Controller -> Validator -> Service -> DAOImpls. So as you know, Controllers are the entry … Continue reading Chain of Responsibility Design Pattern

A Beginner’s Guide to Design Patterns

We use design patterns so that we don’t have to write repeated code again and again for same kind of problem. Design pattern is not a class or piece of code. Its a template which should be implemented based on the situation. Design patterns are divided into following categories:- Behavioral, Creational, Structural Behavioral pattern: As the name explain, Behavioral patterns describe how the objects behave … Continue reading A Beginner’s Guide to Design Patterns

Java 10 Features

So Java SE 10 (JDK 10) was released 20th March 2018. JDK 10 is a production-ready implementation of the Java SE 10 Platform Specification, as specified by JSR 383. Java SE 10 provides a number of new features, including Local variable types, Parallel full GC for G1, Experimental features such as the Java-Based JIT Compiler. etc So this blog can be divided into following categories: What’s New … Continue reading Java 10 Features

Predicates in Java8

Predicates are boolean valued functions which returns true/false based on some conditions. Simple. Predicate<T> in java is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference. Now let’s see how to use Predicates. We have one below Employee class and we want to filter out Employees based on some given conditions. Use Cases Print names of … Continue reading Predicates in Java8