What is Spring Framework?

Introduction This is a series and it would make a lot of sense if read in a sequence. You can find all the posts under the heading "Spring Beginners to Professionals". This is the fifth post of the series. Alright! Let us try and answer the very famous question "What is Spring Framework?". What is Spring Framework? Spring Framework is a beautiful Implementation of Several Design Patterns presented in an abstracted way to an application developer. It is a light weight application development framework written in Java and suitable for Java based applications. A framework defines an abstrac...
Read More

Understanding the Inversion of Control

Introduction This is a series and it would make a lot of sense if read in a sequence. You can find all the posts under the heading "Spring Beginners to Professionals". This is the fourth post of the series. The next important concept is Inversion of Control. In fact, Inversion of Control is the heart of Spring Framework. You might also have heard the short form which is IoC. This post is dedicated for understanding the Inversion of Control in detail. Inversion of Control The one core concept which is not optional in Spring is the “Inversion of Control”. Spring and many similar frameworks...
Read More

Understanding Annotations in Spring

Introduction This is a series and it would make a lot of sense if read in a sequence. You can find all the posts under the heading "Spring Beginners to Professionals". This is the third post of the series. The next important concept is Annotations. Recent versions of Spring Framework shifted to annotation based programming. Prior to version 3.0 majority of Spring configuration was done using XMLs. This post is dedicated for understanding Annotations so that we can have a better understanding of Spring Framework. Basics of Annotations An annotation is a form of syntactic metadata that can...
Read More

Details of Aspect Oriented Programming

Introduction This is a series and it would make a lot of sense if read in a sequence. You can find all the posts under the heading "Spring Beginners to Professionals". This is the second post of the series. Before diving into the Spring Framework, I would like to explain few generic concepts which are used all around Spring and a good understanding of these concepts can make our learning process smoother. The First one is Aspect Oriented Programming. This post is dedicated for understanding the concepts of Aspect Oriented Programming, primarily from the standpoint of Spring Framework. Asp...
Read More

Spring Beginners to Professionals – Introduction

Introduction Dear Readers, upon lot of requests, I have decided to write this new series of posts. This is the first look of a book which I am writing and I would like to share my knowledge and understanding of Spring Framework and its hacks.  This series will be available under the J2EE category under the heading "Spring Beginners to Professionals". As of the time of writing this book and series, the GA version of Spring was 4.2.5, for the new versions few things might vary but more or less concepts and usages will be similar. This is a series and it would make a lot of sense if read i...
Read More

Preserve indices while sorting array

Introduction This is a request from one of the readers. This is mostly useful in competitive programming where you want to sort an array by the values, but at the same time the requirement is to preserve the index of each element. If I have to explain using an example, then consider the array below. The array is zero indexed. The first two rows represent the input array and indices of each element in the array. The next two rows represent the sorted array, but the moment you sort it, the index for each element changes. Earlier A was at index 4 but in the sorted array it is at index ...
Read More

Solving 0/1 Knapsack problem using Dynamic Programming

Introduction A knapsack is a bag with straps, usually carried by soldiers to help them take their valuables or things which they might need during their journey. The 0/1 knapsack problem is a very famous interview problem. The problem statement is as follows: Given a set of items, each of which is associated with some weight and value. Find the subset of items which can be carried into the knapsack with weight limit W. It is required that the cumulative value of the items in the knapsack is maximum value possible. In simple words, it asks you to pick certain items from the set of items ...
Read More