Wednesday 3 August 2011

Spring Interview Questions

1) Explain about spring applications framework?
Spring architecture helps you to manage your business objects. Implementation part of the spring is easy because it helps you to introduce it in the middle of the objects. This framework is easy to implement in testing conditions. This is used by many large vendors.
 
2) State some benefits and advantages of spring framework?
Some of the benefits which spring can offer you are as follows: -
• It is very beneficial for middle tier applications and it can be used in various run time environments.
• Various custom properties need not be used in applications.
• Cost can be reduced by reducing the programming to interface cost ratio.
• Applications built on spring framework are easy to test.
 
3) Explain about portability of spring?
Spring applications and framework are portable between different servers. This framework and applications are portable between many different servers such as Tomcat, Jetty, Web Logic, Web Sphere, Resin, Geronimo, etc. Environment features can be implemented without affecting portability.
 
4) Explain about Bean factory?
Spring is designed to work with Java Beans and this forms the core part of the Spring Framework. This is a generic factory and it lets users and developers to enable objects by name. This helps to manage relationships between objects.
 
5) Explain about the two models of the object which Bean Factory supports?
Two models of object which bean factory supports are: -
1) Single ton and prototype.
Singleton has one instance (shared) with an object and it is assigned a specific name which can be retrieved on lookup.
Prototype results in creation of an independent object.
 
6) Explain about Bean definition Reader interface?
Bean definition reader interface separates Bean factory implementations from metadata format. This is very useful if the application needs different metadata implementations. This framework or interface can be implemented in different ways.
 
7) State about the commonly used Bean Factory definitions?
The most commonly used bean factory definitions are as follows: -
1) XML bean factory and 2) DefaultListable beanfactory.
XMLbean factory is used to parse XML structure to define classes and properties of objects (named).
DefaultListablebeanfactory is useful to program bean factories and parse definitions.
 
8) Explain about inversion control behavior?
Inversion control behavior is obtained through bean factory concept. The best part about this container is it can be coded in a single line and has simple deployment steps. Inversion of control behavior is very useful to avoid heavy containers such as EJB.
 
9) Explain about dependency injection?
Dependency injection is used to remove dependence of explicit coding on container. It resembles to a form of IoC. Java methods are chiefly used to inject dependencies into an object. It is used to collaborate and configure values into an object.
 
10) Explain why an organization needs to implement spring framework?
Spring framework is essential because it touches important aspects such as
1) It is very useful to manage business objects
2) Spring architecture is very flexible it regains its architecture even when you can take some parts of it.
3) Testing part is very efficient and east to use.
4) Vendors recognized its importance and they are using it for enterprise Java development.
 
11) Explain about how to deploy applications using POJOs?
Spring helps you to develop components using POJOs. Spring Framework takes care of your need to build enterprise applications. Infrastructure of your application should be away from the business logic because it can improve the pace of your business logic changes. This is provided by Springs Framework.
 
12) Explain about auto wire support?
When auto wire is used as an optional attribute it reduces the volume of configuration. Auto wire should be used on the root element and this is used to activate auto wiring for all beans. If you would like to add an additional constructor it can be populates without the need to change configuration.
 
13) Explain the three different methods which are provided by the Namespace Handler interface?
The three different methods which are provided by the name space handler interface are: -
1) Init() is used to allow initialization for name space handler.
2) BeanDefinition parse is used when a Spring encounters a top level element.
3) BeanDefinitionHandler is used when spring encounters an attribute.
 
14) Explain about the different ways in which Spring JDBC can help you?
There are several ways in which a spring JDBC can help you they are: -
1) Connection leaks can be avoided.
2) Code can be focused on necessary SQL and it is very low.
3) Applications will never have to depend on RDBMS error specification handling.
4) You can easily implement DAO pattern without business logic.
 
15) Explain about exception wrapping?
Wrapping can be effectively done using spring. It makes the proprietary code to run in the ORM layer to a set of abstracted run time exceptions. Persistence exceptions can be easily handled. Handling of exceptions can be done very easily.

16) Explain about transaction management in spring?
Spring uses its own abstract for transaction management. It uses to deliver
1) Programmatic transaction management through SimpleJdbcTemplate.
2) Declarative transaction management is similar to EJB. It is compatible with superset of EJB CMT with some unique features.
 
17) Explain about integration of spring with AspectJ?
Spring integrates comfortably with AspectJ and this aspect makes it very poular. It makes it possible to include AspectJ aspects into Spring applications. Using Spring IoC container it is possible for dependency inject AspectJ. AspectJ is also used to inject non spring managed POJO using spring. It is uses XML and annotation driven pointcuts.

0 comments:

Post a Comment

Popular Posts

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | cheap international calls