Friday 27 April 2018

Spring Interview Questions

1)  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.


2) 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 joinpoints.


3) What is the default scope of bean in Spring framework?


The default scope of bean is Singleton for Spring framework.


4) Name the types of transaction management that are supported by Spring?


Transaction management supported by Spring are :
Declarative transaction management.
Programmatic transaction management.


5) Is Singleton beans are thread safe in Spring Framework?


No, singleton beans are not thread-safe in Spring framework.


6) 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.


7) 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.


8) Define Bean Wiring?


Bean wiring is the creation of associations between application components that are between the beans in a particular spring container.


9) 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.


10) Why Spring framework is needed?


Spring framework is needed because it is –
Very Light Weight Container
Framework
IOC
AOP


11) 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


12) Explain the RowCallbackHandler in Spring?


The RowCallbackHandler is called for each row in ResultSet and is used to read values from the ResultSet.


13) 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.


14) Write about AOP module?


AOP module is utilized for creating aspects for Spring applications. It also enables support for metadata programming in Spring.


15) What is a BeanFactory Interface?


Bean factory interface is used to provide configuration framework for object creation and basic functionality around object management.

More about Spring:

No comments:

Post a Comment