Thursday 15 August 2013

Spring Basic Interview Questions Part-2 !



Interview Questions

Question: - What is spring?

Answer: - Spring is a lightweight open source framework created to address the complexity of enterprise application development. The layered architecture of this framework is the main advantage, which provides an option for the selection of existing spring modules which we want to use depends upon the requirement. It also provides a well integrated framework for J2EE application development.

Question: - What are the benefits of spring framework?

Answer: - Below are the benefits of spring framework:-

Lightweight: - As per the size and transparency, spring is a very lightweight framework. The Basic version of spring is about 1 MB. Spring does not use much memory and CPU processing head for loading beans. It is a light weight container as compare to other J2EE containers.

Container: - Spring framework container contains and manages the life cycle and configuration of application objects.

Aspect oriented (AOP):- This framework supports Aspect oriented programming. It also provides support for separating the business logic from system services by enabling cohesive development (well-integrated).

Inversion of control (IoC):- Inversion of control is a technique using which we can achieve loose coupling. Inversion of Control pattern tells that no need to create our objects but we should describe how they should be created. No need to directly connect with our components and services together in the code but we should describe which services are needed by which components in a configuration file. A container which is not but spring framework (IOC container) is then responsible for hooking it all up.

JDBC Exception Handling: - Spring provides a meaningful exception hierarchy, which helps to simplify the error handling strategy in Spring JDBC module. It also provides best Integration and well managed services with Hibernate, JDO and iBATIS.

Transaction Management: - It provides a generic abstraction layer for transaction management. This framework provides an option to the developer to add the pluggable transaction managers, and making it easy to set boundaries for transactions without dealing with low-level issues. It assembles several transaction management APIs.

Question: - How many modules are available in spring framework?

Answer: - spring is divided into seven modules which are:-



                                                                  Spring modules

Spring-core container: - spring core container provides the basic and essential functionality of the spring framework. BeanFactory is the primary component of the core container, which is the best example of an implementation of the Factory design pattern. To separate an application's configuration and dependency specification from the actual application code the BeanFactory applies the Inversion of Control (IOC) pattern.

Spring AOP: - Aspect-oriented programming functionality is provided by this Spring AOP module, through its configuration management feature. There is a way through which we can easily enable AOP in any application managed by the Spring framework. The Spring AOP module provides transaction management services for objects in any Spring-based application. With the help of this Spring AOP module we can combine declarative transaction management into our applications without depending on EJB components.

Spring context: - Spring context is nothing but a configuration file that provides context information to the Spring framework. Spring context module includes enterprise services such as e-mail, internalization, validation, JNDI, EJB and scheduling functionality.

Spring DAO: - This Spring DAO module provides a meaningful exception hierarchy for managing the exception handling and error messages thrown by different database vendors. It helps in exception hierarchy for simplifying error handling. It also helps to reduce the application code we need to write, such as opening and closing connections.
Spring ORM: - This module helps to plug into several ORM frameworks to provide its Object mapping with the Relational tool, including Hibernate, JDO and iBatis SQL Maps.

Spring Web module: - This module is build on top of the application context module, providing contexts for Web-based applications. This framework supports integration with Jakarta Struts. The Web module also eases the tasks of handling multi-part requests and binding request parameters to domain objects.

Spring MVC framework: - This Spring module is full-featured MVC implementation for building Web applications. This MVC framework is highly configurable via strategy interfaces and accommodates numerous view technologies including Freemarker, JSP, Velocity, Jasper Reports, Tiles, iText, and POI.

No comments:

Post a Comment