Q1. What is Spring?
Wikipedia defines the Spring framework as “an application framework and inversion
of control container for the Java platform. The framework’s core features can be
used by any Java application, but there are extensions for building web applications
on top of the Java EE platform.” Spring is essentially a lightweight, integrated
framework that can be used for developing enterprise applications in java.
Q2. Name the different modules of the Spring framework.
Some of the important Spring Framework modules are:
Spring Context – for dependency injection.
Spring AOP – for aspect oriented programming.
Spring DAO – for database operations using DAO pattern
Spring JDBC – for JDBC and DataSource support.
Spring ORM – for ORM tools support such as Hibernate
Spring Web Module – for creating web applications.
Spring MVC – Model-View-Controller implementation for creating web
applications, web services etc.
Q3. List some of the important annotations in annotation-based
Spring configuration.
The important annotations are:
@Required
@Autowired
@Qualifier
@Resource
@PostConstruct
@PreDestroy
Q4. Explain Bean in Spring and List the different Scopes of Spring
bean.
Beans are objects that form the backbone of a Spring application. They are
managed by the Spring IoC container. In other words, a bean is an object that is
instantiated, assembled, and managed by a Spring IoC container.
There are five Scopes defined in Spring beans.