• Spring Basics

    SPRING FRAMEWORK 3.1.2 RELEASED

    Spring is the most popular application development framework for enterprise Java™. Millions of developers use Spring to create high performing, easily testable, reusable code without any lock-in. The second maintenance release in the Spring 3.1.x line is now available via Maven Central, the SpringSource repository, or for direct download from our community download page. This release includes many important bugfixes and minor improvements and is a recommended upgrade. Download | Documentation | Javadoc API | Change Log | JIRA

    Comments Off on SPRING FRAMEWORK 3.1.2 RELEASED
  • Interview Questions,  spring,  Spring Basics,  Spring Interview Questions

    What is IOC also known as inversion of control?

    Inversion of control or dependency injection (which is a specific type of IoC) is a term used to resolve objectdependencies by injecting an instantiated object to satisfy dependency as opposed to explicitly requesting anobject. So objects will not be explicitly requested but objects are provided as needed with the help of an Inversion Of Controller container (e.g. Spring etc). This is analogous to the Hollywood principal where the servicing objects say to the requesting client code (i.e. the caller) “don’t call us, we’ll call you”. Hence it is called inversion of control. Many of us are familiar with the software development context where client code collaborates with other dependent objects (or servicing objects) by…

    Comments Off on What is IOC also known as inversion of control?
  • DI,  spring,  Spring Basics,  Spring Interview Questions

    Different types of dependency injection(DI)

    There are two types of dependency injection: setter injection and constructor injection. Setter Injection: Normally in all the java beans, we will use setter and getter method to set and get the value of property as follows: public class namebean {String name; public void setName(String a) {name = a; }public String getName() {return name; }} We will create an instance of the bean ‘namebean’ (say bean1) and set property as bean1.setName(“tom”); Here in setter injection, we will set the property ‘name’ in spring configuration file as showm below:<bean id=”bean1″ class=”namebean”><property name=”name” ><value>tom</value></property></bean>The subelement <value> sets the ‘name’ property by calling the set method as setName(“tom”); This process is called setter…

    Comments Off on Different types of dependency injection(DI)
  • DI,  IOC,  spring,  Spring Basics,  Spring Interview Questions

    Inversion of Control (IOC) Vs Dependency Injection (DI)

    IOC and DI are one of the same thing in aspects of Spring frame work, Both are meant to be for same functionality. Dependency injection (DI) is a programming design pattern and architectural model, sometimes also referred to as inversion of control or IOC, although technically speaking, dependency injection specifically refers to an implementation of a particular form of IOC. Dependency Injection describes the situation where one object uses a second object to provide a particular capacity. For example, being passed a database connection as an argument to the constructor instead of creating one internally. The term “Dependency injection” is a misnomer, since it is not a dependency that is…

    Comments Off on Inversion of Control (IOC) Vs Dependency Injection (DI)