Mediator pattern is a Behavioral Design pattern. It is used to handle complex communications between related Objects, helping by decoupling those objects. Intent Mediator pattern defines an object that encapsulates how a set of objects interact. Mediator promotes loose coupling of Objects by keeping them from referring to each other directly, and i...

Read More

The java.util.concurrent.CyclicBarrier class is a synchronization aid that allows a set of threads to wait for each other until all reaches to a common barrier point. In other words, consider multiple threads are executing concurrently to finish a task, where each of the thread is responsible for finishing a sub-task. When all the sub-tasks are com...

Read More

Note: This post is inspired by and is an attempt at creating an extension to this post on Medium. As such, it will use some of the code in that post by Joel Planes. As a Java developer, the most common task we have to do is to write some server-side validations for our model data so as to validate the incoming objects to our application. Sure there...

Read More

Use non synchronized Collection: Use ArrayList, HashMap as opposed to Vector, Hashtable etc. Thus we can avoid the synchronization overhead. Even more better is to use an array where possible. If multiple threads are concurrently access a collection and at least one of the threads either adds or deletes an entry into the collection, then the collec...

Read More

Given weights and values of n items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack. In other words, given two integer arrays val[0..n-1] and wt[0..n-1] which represent values and weights associated with n items respectively. Also given an integer W which represents knapsack capacity, find out the maximum...

Read More

As per Spring's documentation, Spring Boot allows us to externalize configurations, so you can work with the same application code in different environments. You can use property files, YAML files, environment variables, and command-line arguments to externalize configurations. But in this article we will mostly check how to read configurations fro...

Read More

The Chain of Responsibility (COR) design pattern is used when more than one object handles a request and performs their corresponding responsibilities to complete the whole task. The pattern can be used to achieve loose coupling in software design, where the request can be passed through a chain of objects or request handler for processing. Based o...

Read More

Overriding : Declaring a method in subclass which is already present in parent class is known as method overriding. This is also known as run-time polymorphism. Here a sub class or a derived class provides detailed implementation of a method which is already declared or defined in the parent class. The implementation to be executed is decided at ru...

Read More

In Computer Science Producer Consumer Problem also known as the bounded-buffer problem) is a classic example of a multi-process synchronization problem. The problem describes two processes, the producer and the consumer, who share a common, fixed-size buffer used as a queue. The producer's job is to generate data, put it into the buffer, and start ...

Read More

“Microservice” is a buzzword these days and many tech-savvy organizations are adopting microservices to create independent, highly scalable and easily maintainable services that exhibit highly single responsibility principle. Spring boot plays a major role in helping developers build microservices from scratch. To achieve this highly scalable archi...

Read More

FOLLOW US ON LinkedIn



Explore Tutu'rself