Posts

Agile Methodology – Know the What and How?

Image
Gone are the days of using traditional software development models such as the Waterfall model. In today’s fast-paced IT world Agile is a new way forward. So in this blog, I will discuss What is Agile methodology. After reading this blog, your understanding of Agile will be crystal clear. Why do we need Agile methodology? Before Agile came into the picture, we had the Waterfall model of software development. The waterfall model can be defined as a sequential process in the development of a system or software that follows a top-down approach. This model was a straight forward and linear model. The waterfall model had various phases such as Requirements Gathering, Software Design, Implementation, Testing, Deployment, and Maintenance. This model however suffered a few drawbacks such as follows: This model was too time-consuming. Unless you complete a particular stage, you cannot proceed to the further stages. This model was suitable only for projects where requirements are stable. The wor...

Use of DispatcherServlet in Spring MVC Framework

Image
If you have worked with Spring MVC then you should know   what is a DispatcherServlet?   It's actually the heart of Spring MVC, precisely the C of MVC design pattern or Controller. Every single web request which is supposed to be processed by Spring MVC goes through DispatcherServlet. In general, it's an implementation of Front Controller Pattern which provides a single point of entry in your application. It handles all incoming requests. It is also the bridge between Java and Spring. Btw, the   DispatcherServlet   is like any other Servlet is declared in the web.xml with a URL pattern but the only special thing is that the URL pattern for dispatcher servlet is enough to map every single web request to DispathcherServlert. It is responsible for request handling by delegating requests to additional components of Spring MVC e.g. actual controller classes i.e. those which are annotated using   @Controller   or   @RestController   (in case of RESTful ...

Avoid Deadlock in Java

Image
  Java programming language supports multithreading. It involves multiple threads running simultaneously for multitasking. But in certain cases or due to certain shortcomings, the threads find themselves in the waiting state forever. In this article, We will understand the deadlock condition in Java and different ways to avoid it. The following are the topics discussed in this article: What is Deadlock in Java? Deadlock Example How To Avoid Deadlock in Java? What is Deadlock in Java? Deadlock in Java is a condition where two or more threads are blocked forever, waiting for each other. This usually happens when multiple threads need the same locks but obtain them in different orders. Multithreaded Programming in Java suffers from the deadlock situation because of the synchronized keyword. It causes the executing thread to block while waiting for the lock, or monitor, associated with the specified object. Deadlock Example public class Example { public static void main(String[] arg...

Java 8 Stream API

  Introduced in   Java 8   along with other programming features,   Stream API   provides various functionalities to process a collection of objects. Before we dive into Streams API, let’s see for an example, how we used to iterate a List and calculate the sum before the introduction of Streams in Java 8. List<Integer> numList = Arrays.asList(2,5,7,9,10,20,30,40); int sum = 0; Iterator<Integer> iterator = numList.iterator(); while (iterator.hasNext()) { int number = iterator.next(); if (number< 10) { sum += number; } } The above codes works perfectly fine and the variable sum will have the value 23 as the sum of numbers less than 10, but there are few issues with this code. The code has to be written on how the list should be iterated although the requirement is just to obtain the sum of the numbers which are less than 10 The program is sequential A lot of code must be written to perform this simple calculation. To avoid the above ...

The TRUE difference between [] and {{}} bindings in Angular

  One of the parts of Angular that most developers think they understand, but many don’t, is the true nature of [] and {{}} bindings. A fundamental lack of understanding of these bindings can become a major issue when working with templates and trying to get them to do exactly what you want. It can also be the cause of spending an unnecessary amount of hours trying to figure out a bug. So I’m going to run down exactly what these two bindings do, and what it is that many developers misunderstand about them. You’re probably familiar with the typical usage of {{}} bindings: <h1>{{title}}</h1> And you’re probably familiar with the typical usage of [] or property bindings: <img [src]="imgsrc"> But do you truly understand what each binding is doing? And why we use them in this situation? Many if not most developers simply know to use {{}} when putting text in an element, and [] for binding to properties. But have you ever wondered with reactive forms why the  form...