What is a spring?
Spring is set to be a framework which helps Java programmer for development of code and it provides IOC container, Dependency Injector, MVC flow and many other APIs for the java programmer.
What are Advices in Spring?
It is the execution of an aspect. Advice is like making your application learn a new trick. They are usually introduced at join points.
What is the default scope of bean in Spring framework?
The default scope of bean is Singleton for Spring framework.
Name the types of transaction management that are supported by Spring?
Transaction management supported by Spring are:
·         Declarative transaction management.
·         Programmatic transaction management.
Is Singleton beans being thread safe in Spring Framework?
No, singleton beans are not thread-safe in Spring framework.
What are the benefits of Spring Framework?
Following are the benefits of Spring framework:
·         Extensive usage of Components
·         Reusability
·         Decoupling
·         Reduces coding effort by using pattern implementations such as singleton, factory, service locator etc.
·         Removal of leaking connections
·         Declarative transaction management
·         Easy to integrate with third party tools and technologies.
What is Bean Factory?
Bean Factory is core of the spring framework and, it is a Lightweight container which loads bean definitions and manages your beans.  Beans are configured using XML file and manage singleton defined bean. It is also responsible for life cycle methods and injects dependencies. It also removes adhoc singletons and factories.
Define Bean Wiring?
Bean wiring is the creation of associations between application components that are between the beans in a particular spring container.
What is called Spring MVC?
A Spring MVC is a single shared controller instance and it is used to handle request type controllers, interceptors which run in the IoC container. It also allows multiple Dispatcher Servlets which can share application context interface but not class based interface.
Why Spring framework is needed?
Spring framework is needed because it is –
·         Very Light Weight Container
·         Framework
·         IOC
·         AOP
Name the various modules used in spring framework?
·         AOP module (Aspect Oriented Programming)
·         JDBC abstraction and DAO module
·         The Core container module
·         MVC framework module
·         Application context module
·         O/R mapping integration module (Object/Relational)
·         Web module
Explain the RowCallbackHandler in Spring?
The RowCallbackHandler is called for each row in ResultSet and is used to read values from the ResultSet.
Define Application context module?
This is a very important module and supplies various necessary services like EJB integration, remoting, JNDI access and scheduling. It transforms spring into a framework. It also broadens the idea of BeanFactory by application of lifecycle events, providing support for internationalization messages and validation.
Write about AOP module?
AOP module is utilized for creating aspects for Spring applications. It also enables support for metadata programming in Spring.
What is a Bean Factory Interface?
Bean factory interface is used to provide configuration framework for object creation and basic functionality around object management.
State the differences between ApplicationContext and BeanFactory in spring?
·         ApplicationContext allows more than one config files to exist while BeanFactory only permits one.
·         ApplicationContext can print events to beans registered as listeners. This feature is not supported by BeanFactory.
·         ApplicationContext also provides support for application of lifecycle events, internationalization messages and validation and also provides services like EJB integration, remoting, JNDI access and scheduling. These features too are not supported by Bean Factory.
What is Auto Wiring?
Autowiring is used to build relationships between the collaborating beans. Spring container can automatically resolve collaborators for beans.
What are the different Modes of Autowiring?
Autowiring has five different modes:
·         no: no autowire
·         byName: Autowiring that can be done by property name
·         byType: property type as autowired
·         constructor: It is similar to byType and it is property is in constructor
·         autodetect:  Spring is allowed to select autowiring from byType or constructor
How to start using spring?
Following steps needs to be done to start with the Spring:
·         Download Spring and its dependent file from spring’s site.
·         Create application context xml to define beans and its dependencies
·         Integrate application context xml with web.xml
·         Deploy and Run the application
What are the methods of bean life cycle?
There are two important methods of Bean life cycle:
·         Setup – called when bean is loaded into container
·         Teardown – called when bean is unloaded into container
What are the different types of events of Listeners?
Following are the different types of events of listeners:
·         Context Closed Event – This event is called when the context is closed.
·         Context Refreshed Event – This event is called when context is initialized or refreshed
·         Request Handled Event – This event is called when the web context handles request
Differentiate between singleton and prototype bean?
Singleton means only one bean is defined per object instance while Prototype means one definition to more than one object instances in Spring.
What are the types of Dependency Injection?
Two types of dependency injection are supported by spring framework:
·         Setter Injection
·         Constructor Injection
Write about Core container module?
Core container module is responsible for the basic functionality of the spring framework. The whole Spring framework is built with this module as a base.
What is AOP module?
This AOP module is used for spring enabled application. Support has been provided AOP alliance to ensure the interoperability between spring and other AOP frameworks.
It instructs spring to add annotations to the source code and tell how to apply aspects.
What is AOP Alliance?
AOP alliance is an open-source project which is aimed at promoting adoption of AOP. The AOP alliance’s goal is to define a common set of components and interfaces so as to improve interoperability among different AOP implementations.
What is Inner bean? What is the drawback of inner bean?
If a bean element is directly embedded in a property tag while wiring beans, then the bean is called Inner Bean. Its drawback is that it cannot be reprocessed.
What are the different types of Injection in spring?
There are three types of Injection in spring:
·         Setter Injection
·         Constructor Injection
·         Getter or Method Injection
What are the benefits of spring framework?
Following are the benefits of spring framework:
·         Light weight container when compared to j2EE containers
·         Built in Web MVC framework
·         Creates loosely coupled applications
·         Supports aspect oriented programming like logging, transaction and security
·         Configuration done in XML format which is easy to write and understand
What are the types of Advice?
There are five types of Advice:
·         Before Advice
·         After returning advice
·         After throwing advice
·         Finally advice
·         Around advice
What is called Prepared Statement Creator?
Prepared Statement Creator is one of the most commonly used interfaces for writing data to the database. createPreparedStatement() is a method that can be used to create and return Prepared Statement from the Connection argument, and exception handling is automatically taken care of. When this interface is implemented, a different interface SqlProvider can also be implemented which has a method called getSql(). This method is useful for providing sql strings to the Jdbc Template. It does not handle SQL Exceptions.
What is SQL Provider?

SQL Provider has only one method called getSql()and it is implemented using PreparedStatementCreator implementers. It is mainly used for debugging.
Request to Download PDF

Post A Comment: