Dependency Injection in Spring using Annotation

Overview In previous blog we saw Dependency Injection in Spring using XML. Here we will see how we can do same using Annotation Construction Injection using Annotation xml file Paint class Car class Main class Explanation In xml we are telling Spring to look for a package to scan for Annotation based configurations like in this case @Component and @Autowired . @Autowired above Car is way of injecting Bean as a Constructor Setter Injection using Read more…

Dependency Injection in Spring using XML

Overview In my previous blog we saw an overview of Spring IoC and DI. Here we will see Dependency Injection (DI) in detail by answering following question: What is DI Ways of injecting Dependency using XML Dependency Injection Dependency Injection (DI) is a design pattern that removes the dependency from the programming code so that it can be easy to manage and test the application. Dependency Injection makes our programming code loosely coupled. Ways of Read more…

Inversion of Control and Dependency Injection with Spring – Overview

Overview In this blog, we will cover following points What is IoC Spring IoC Container Dependency Injection in Spring Example Code Inversion of Control(IoC) Inversion of Control is a principle in software engineering by which the control of objects or portions of a program is transferred to a container or framework. Inversion of Control can be achieved through various mechanisms such as: Strategy design pattern, Service Locator pattern, Factory pattern, and Dependency Injection (DI). Spring Read more…

Spring – An Overview

Overview Spring is a framework for dependency-injection which is a pattern that allows to build very decoupled systems. The Spring Framework is divided into modules. Applications can choose which modules they need. At the heart are the modules of the core container, including a configuration model and a dependency injection mechanism. Official Website Spring Release Spring 1     : 2004 Spring 2     : 2006 Spring 3     : 2009 Spring 4     : 2013 Read more…

Reflection in Java

Overview In this blog, we will cover the following points What is Reflection API? Using private methods Using private fields Sample Code Reflection API Reflection allows instantiation of new objects, invocation of methods, and get/set operations on class variables dynamically at run time without having prior knowledge of its implementation. Real-World Example: Take for example your typical web.xml file. This will contain a list of servlet elements, which contain nested servlet-class elements. The servlet container Read more…

JAX-RS Specification and Implementation provider

Overview In this blog, we will cover What is JAX-RS JAX-RS Specification Implementation provider for JAX-RS Why follow JAX-RS What is JAX-RS JAX-RS: Java API for RESTful Web Services (JAX-RS) is a Java programming language API spec that provides support in creating web services according to the Representational State Transfer (REST) architectural pattern. JAX-RS 2.0 was released in May 2013. JAX-RS 2.1 was released in Sep 2017. JAX-RS Specification JAX-RS provides some annotations to aid in mapping Read more…

JVM, JDK, and JRE

Overview In this blog, we will cover the following points What is JVM, JRE & JDK Steps to run a java file JVM (Java Virtual machine) JVM is responsible for converting Byte code to the machine-specific code. JVM is also platform-dependent and provides core java functions like memory management, garbage collection, security, etc. JRE (Java Runtime Environment) Java Runtime Environment is the implementation of JVM, it provides platform to execute java programs. JRE consists of Read more…

Configure Git for Pull and Push

Overview In this Blog, we will see how to configure and use Git to Pull and Push Data. Assumption:  Git is already installed in your Machine. If not, you can refer to Install Git on Linux, Mac or Windows Download Project from Git Repository (Github/Bitbucket) There are 2 ways to use Git => SSH/HTTPS SSH You need to add your SSH key to Github or Bitbucket Account. In order to Pull/Push repository. Your key will be Read more…

Install Git on Linux, Mac or Windows

Windows Setting up Git on Windows OS is pretty simple. You will need to download the installer from Git website Run the downloaded .exe file. Follow the instructions in Dialog. It is strongly recommended that you keep the default settings. After installation is done. You can manage your git repository by Git GUI or can use Terminal. You can open a terminal/command prompt and check git –version to see if Git in installed correctly. Mac OS Read more…

Glowroot – Java Application Performance Management (APM)

This blog will cover What is APM Glowroot – Overview Configuration – Embedded Collector Persistence Option with Docker – Central Collector What is APM? In a production environment, it’s important to keep an eye on resource consumption. This is where various monitoring tools come in. When it comes to Java there are various open-source monitoring tools. One of which is Glowroot. I personally like Glowroot because of its simplicity and ease to configure. Glowroot Glowroot Read more…