InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What Is Ioc (or Dependency Injection)? |
|
Answer» The basic concept of the Inversion of Control pattern (also KNOWN as dependency injection) is that you do not create your objects but describe how they should be created. You don't directly connect your components and services together in code but describe which services are needed by which components in a configuration file. A container (in the case of the Spring framework, the IOC container) is then RESPONSIBLE for hooking it all up. The basic concept of the Inversion of Control pattern (also known as dependency injection) is that you do not create your objects but describe how they should be created. You don't directly connect your components and services together in code but describe which services are needed by which components in a configuration file. A container (in the case of the Spring framework, the IOC container) is then responsible for hooking it all up. |
|
| 2. |
What Are The Different Types Of Ioc (dependency Injection) ? |
|
Answer» There are three types of DEPENDENCY injection: There are three types of dependency injection: |
|
| 3. |
What Are The Benefits Of Ioc (dependency Injection)? |
|
Answer» Benefits of IOC (Dependency Injection) are as follows: Benefits of IOC (Dependency Injection) are as follows: |
|
| 4. |
What Are The Common Implementations Of The Application Context ? |
|
Answer» The three commonly used implementation of 'APPLICATION Context' are The three commonly used implementation of 'Application Context' are |
|
| 5. |
What Is Java Server Faces (jsf) - Spring Integration Mechanism? |
|
Answer» Spring provides a custom JavaServer Faces VariableResolver implementation that extends the standard JavaServer Faces managed beans mechanism. When asked to resolve a variable name, the following algorithm is PERFORMED: Spring provides a custom JavaServer Faces VariableResolver implementation that extends the standard JavaServer Faces managed beans mechanism. When asked to resolve a variable name, the following algorithm is performed: |
|
| 6. |
What Is Significance Of Jsf- Spring Integration ? |
|
Answer» Spring - JSF integration is useful when an EVENT handler wishes to explicitly invoke the bean FACTORY to create beans on demand, such as a bean that ENCAPSULATES the business logic to be PERFORMED when a submit button is PRESSED. Spring - JSF integration is useful when an event handler wishes to explicitly invoke the bean factory to create beans on demand, such as a bean that encapsulates the business logic to be performed when a submit button is pressed. |
|
| 7. |
What Are Orm's Spring Supports ? |
|
Answer» SPRING supports the FOLLOWING ORM’s : Spring supports the following ORM’s : |
|
| 8. |
What Are The Ways To Access Hibernate Using Spring ? |
|
Answer» There are TWO approaches to SPRING’s Hibernate integration: There are two approaches to Spring’s Hibernate integration: |
|
| 9. |
How To Integrate Spring And Hibernate Using Hibernatedaosupport? |
|
Answer» SPRING and Hibernate can integrate using Spring’s SessionFactory CALLED LocalSessionFactory. The INTEGRATION process is of 3 steps. Spring and Hibernate can integrate using Spring’s SessionFactory called LocalSessionFactory. The integration process is of 3 steps. |
|
| 10. |
How The Aop Used In Spring? |
|
Answer» AOP is USED in the Spring Framework: To provide declarative ENTERPRISE services, especially as a replacement for EJB declarative services. The most important such service is declarative transaction MANAGEMENT, which builds on the Spring Framework's transaction abstraction.To allow users to IMPLEMENT custom aspects, complementing their use of OOP with AOP. AOP is used in the Spring Framework: To provide declarative enterprise services, especially as a replacement for EJB declarative services. The most important such service is declarative transaction management, which builds on the Spring Framework's transaction abstraction.To allow users to implement custom aspects, complementing their use of OOP with AOP. |
|
| 11. |
What Do You Mean By Aspect ? |
|
Answer» A modularization of a concern that cuts across MULTIPLE objects. Transaction management is a good example of a crosscutting concern in J2EE applications. In Spring AOP, aspects are IMPLEMENTED USING regular classes (the schema-based APPROACH) or regular classes annotated with the @Aspect annotation (@AspectJ style). A modularization of a concern that cuts across multiple objects. Transaction management is a good example of a crosscutting concern in J2EE applications. In Spring AOP, aspects are implemented using regular classes (the schema-based approach) or regular classes annotated with the @Aspect annotation (@AspectJ style). |
|
| 12. |
What Do You Mean By Jointpoint? |
|
Answer» A POINT during the execution of a program, such as the execution of a METHOD or the handling of an EXCEPTION. In SPRING AOP, a join point always represents a method execution. A point during the execution of a program, such as the execution of a method or the handling of an exception. In Spring AOP, a join point always represents a method execution. |
|
| 13. |
What Do You Mean By Advice? |
|
Answer» ACTION taken by an aspect at a particular JOIN point. Different TYPES of advice INCLUDE "around," "before" and "after" advice. Many AOP frameworks, including Spring, model an advice as an INTERCEPTOR, maintaining a chain of interceptors "around" the join point. Action taken by an aspect at a particular join point. Different types of advice include "around," "before" and "after" advice. Many AOP frameworks, including Spring, model an advice as an interceptor, maintaining a chain of interceptors "around" the join point. |
|
| 14. |
What Are The Types Of The Transaction Management Spring Supports ? |
|
Answer» SPRING Framework SUPPORTS: Spring Framework supports: |
|
| 15. |
What Are The Benefits Of The Spring Framework Transaction Management ? |
|
Answer» The Spring Framework provides a consistent abstraction for transaction management that DELIVERS the FOLLOWING benefits: The Spring Framework provides a consistent abstraction for transaction management that delivers the following benefits: |
|
| 16. |
Why Most Users Of The Spring Framework Choose Declarative Transaction Management ? |
|
Answer» Most users of the Spring Framework choose declarative transaction management because it is the OPTION with the least impact on application CODE, and HENCE is most consistent with the ideals of a non-invasive lightweight container. Most users of the Spring Framework choose declarative transaction management because it is the option with the least impact on application code, and hence is most consistent with the ideals of a non-invasive lightweight container. |
|
| 17. |
Explain The Similarities And Differences Between Ejb Cmt And The Spring Framework's Declarative Transaction Management ? |
|
Answer» The basic approach is similar: it is POSSIBLE to SPECIFY transaction behavior (or lack of it) down to individual method level. It is possible to make a setRollbackOnly() call within a transaction context if necessary. The differences are: The basic approach is similar: it is possible to specify transaction behavior (or lack of it) down to individual method level. It is possible to make a setRollbackOnly() call within a transaction context if necessary. The differences are: |
|
| 18. |
When To Use Programmatic And Declarative Transaction Management ? |
|
Answer» Programmatic transaction management is usually a GOOD idea only if you have a small number of TRANSACTIONAL operations. On the other HAND, if your application has numerous transactional operations, declarative transaction management is usually worthwhile. It keeps transaction management out of business LOGIC, and is not difficult to CONFIGURE. Programmatic transaction management is usually a good idea only if you have a small number of transactional operations. On the other hand, if your application has numerous transactional operations, declarative transaction management is usually worthwhile. It keeps transaction management out of business logic, and is not difficult to configure. |
|
| 19. |
Explain About The Spring Dao Support ? |
|
Answer» The Data ACCESS Object (DAO) SUPPORT in Spring is aimed at making it easy to WORK with data access technologies like JDBC, Hibernate or JDO in a consistent way. This ALLOWS one to switch between the persistence technologies fairly easily and it also allows one to code without worrying about catching exceptions that are specific to each technology. The Data Access Object (DAO) support in Spring is aimed at making it easy to work with data access technologies like JDBC, Hibernate or JDO in a consistent way. This allows one to switch between the persistence technologies fairly easily and it also allows one to code without worrying about catching exceptions that are specific to each technology. |
|
| 20. |
What Are The Exceptions Thrown By The Spring Dao Classes ? |
|
Answer» SPRING DAO classes THROW exceptions which are subclasses of DataAccessException . Spring provides a convenient translation from technology-specific exceptions like SQLException to its own EXCEPTION class hierarchy with the DataAccessException as the root exception. These exceptions wrap the ORIGINAL exception. Spring DAO classes throw exceptions which are subclasses of DataAccessException . Spring provides a convenient translation from technology-specific exceptions like SQLException to its own exception class hierarchy with the DataAccessException as the root exception. These exceptions wrap the original exception. |
|
| 21. |
What Is Sqlexceptiontranslator ? |
|
Answer» SQLEXCEPTIONTRANSLATOR, is an INTERFACE to be IMPLEMENTED by classes that can translate between SQLExceptions and Spring's own data-access-strategy-agnostic org.springframework.dao.Data Access EXCEPTION. SQLExceptionTranslator, is an interface to be implemented by classes that can translate between SQLExceptions and Spring's own data-access-strategy-agnostic org.springframework.dao.Data Access Exception. |
|
| 22. |
What Is Spring's Jdbctemplate ? |
|
Answer» Spring's JDBCTEMPLATE is CENTRAL class to interact with a database through JDBC. JdbcTemplate provides many convenience methods for doing things such as converting database DATA into primitives or objects, executing prepared and callable statements, and providing custom database ERROR handling. Spring's JdbcTemplate is central class to interact with a database through JDBC. JdbcTemplate provides many convenience methods for doing things such as converting database data into primitives or objects, executing prepared and callable statements, and providing custom database error handling. |
|
| 23. |
What Is Preparedstatementcreator ? |
|
Answer» PreparedStatementCreator: PreparedStatementCreator: |
|
| 24. |
What Is Sqlprovider ? |
|
Answer» SQLPROVIDER: SQLProvider: |
|
| 25. |
What Is Rowcallbackhandler ? |
|
Answer» The RowCallbackHandler interface EXTRACTS VALUES from each row of a ResultSet. The RowCallbackHandler interface extracts values from each row of a ResultSet. |
|
| 26. |
What Are The Different Types Of Autoproxying? |
|
Answer» ► BeanNameAutoProxyCreator ► BeanNameAutoProxyCreator |
|
| 27. |
What Are The Different Advice Types In Spring? |
|
Answer» ► AROUND : INTERCEPTS the calls to the target METHOD ► Around : org.aopalliance.intercept.MethodInterceptor ► Around : Intercepts the calls to the target method ► Around : org.aopalliance.intercept.MethodInterceptor |
|
| 28. |
What Are The Different Points Where Weaving Can Be Applied? |
|
Answer» ► COMPILE TIME ► Compile Time |
|
| 29. |
What Is Meant By Weaving? |
|
Answer» The PROCESS of applying aspects to a TARGET object to create a NEW proxy object is called as Weaving. The aspects are woven into the target object at the specified JOIN points. The process of applying aspects to a target object to create a new proxy object is called as Weaving. The aspects are woven into the target object at the specified join points. |
|
| 30. |
What Is A Proxy? |
|
Answer» A PROXY is an OBJECT that is created after APPLYING advice to a TARGET object. When you think of client objects the target object and the proxy object are the same. A proxy is an object that is created after applying advice to a target object. When you think of client objects the target object and the proxy object are the same. |
|
| 31. |
What Is A Target? |
|
Answer» A target is the class that is being advised. The class can be a third PARTY class or your own class to which you WANT to add your own custom behavior. By using the CONCEPTS of AOP, the target class is free to center on its MAJOR concern, unaware to any advice that is being APPLIED. A target is the class that is being advised. The class can be a third party class or your own class to which you want to add your own custom behavior. By using the concepts of AOP, the target class is free to center on its major concern, unaware to any advice that is being applied. |
|
| 32. |
What Is An Introduction In Aop? |
|
Answer» An introduction allows the user to ADD NEW methods or attributes to an existing CLASS. This can then be introduced to an existing class without having to change the structure of the class, but give them the new behavior and state. An introduction allows the user to add new methods or attributes to an existing class. This can then be introduced to an existing class without having to change the structure of the class, but give them the new behavior and state. |
|
| 33. |
What Is An Advice? |
|
Answer» Advice is the implementation of an ASPECT. It is SOMETHING LIKE TELLING your APPLICATION of a new behavior. Generally, and advice is inserted into an application at joinpoints. Advice is the implementation of an aspect. It is something like telling your application of a new behavior. Generally, and advice is inserted into an application at joinpoints. |
|
| 34. |
What Is A Jointpoint? |
|
Answer» A joinpoint is a point in the execution of the application where an aspect can be plugged in. This point could be a method being CALLED, an exception being thrown, or even a FIELD being MODIFIED. These are the points where your aspects code can be inserted into the normal flow of your application to ADD new behavior. A joinpoint is a point in the execution of the application where an aspect can be plugged in. This point could be a method being called, an exception being thrown, or even a field being modified. These are the points where your aspects code can be inserted into the normal flow of your application to add new behavior. |
|
| 35. |
What Are Different Types Of Autowire Types? |
|
Answer» There are FOUR different TYPES by which autowiring can be done. There are four different types by which autowiring can be done. |
|
| 36. |
What Are The Different Types Of Bean Injections? |
|
Answer» There are two types of BEAN INJECTIONS. There are two types of bean injections. |
|
| 37. |
What Are Inner Beans? |
|
Answer» When wiring beans, if a BEAN element is embedded to a property TAG directly, then that bean is said to the INNER Bean. The DRAWBACK of this bean is that it cannot be reused anywhere else. When wiring beans, if a bean element is embedded to a property tag directly, then that bean is said to the Inner Bean. The drawback of this bean is that it cannot be reused anywhere else. |
|
| 38. |
What Are The Important Beans Lifecycle Methods? |
|
Answer» There are TWO important bean lifecycle methods. The first one is SETUP which is called when the bean is loaded in to the CONTAINER. The SECOND method is the teardown method which is called when the bean is unloaded from the container. There are two important bean lifecycle methods. The first one is setup which is called when the bean is loaded in to the container. The second method is the teardown method which is called when the bean is unloaded from the container. |
|
| 39. |
How To Integrate Your Struts Application With Spring? |
|
Answer» To integrate your Struts APPLICATION with Spring, we have two options: To integrate your Struts application with Spring, we have two options: |
|
| 40. |
What Is Significance Of Jsf- Spring Integration? |
|
Answer» SPRING - JSF integration is USEFUL when an EVENT handler wishes to explicitly invoke the bean factory to create beans on demand, such as a bean that encapsulates the business logic to be performed when a submit BUTTON is pressed. Spring - JSF integration is useful when an event handler wishes to explicitly invoke the bean factory to create beans on demand, such as a bean that encapsulates the business logic to be performed when a submit button is pressed. |
|
| 41. |
Explain Bean Lifecycle In Spring Framework? |
|
Answer» 1. The spring container finds the beans DEFINITION from the XML file and instantiates the bean. 1. The spring container finds the beans definition from the XML file and instantiates the bean. |
|
| 42. |
What Is Xmlbeanfactory? |
|
Answer» BeanFactory has many implementations in Spring. But one of the most useful one is org .spring framework .beans .factory .XML .XmlBeanFactory, which loads its beans based on the definitions contained in an XML file. To create an XmlBeanFactory, pass a java.io.InputStream to the constructor. The INPUT Stream will PROVIDE the XML to the factory. For EXAMPLE, the following code snippet uses a java .io .FileInput Stream to provide a bean definition XML file to XmlBeanFactory. BeanFactory has many implementations in Spring. But one of the most useful one is org .spring framework .beans .factory .xml .XmlBeanFactory, which loads its beans based on the definitions contained in an XML file. To create an XmlBeanFactory, pass a java.io.InputStream to the constructor. The Input Stream will provide the XML to the factory. For example, the following code snippet uses a java .io .FileInput Stream to provide a bean definition XML file to XmlBeanFactory. |
|
| 43. |
What Does A Simple Spring Application Contain? |
|
Answer» These applications are like any Java application. They are made up of several classes, each performing a specific PURPOSE WITHIN the application. But these classes are configured and INTRODUCED to each other through an XML file. This XML file describes how to configure the classes, known as the Spring CONFIGURATION file. These applications are like any Java application. They are made up of several classes, each performing a specific purpose within the application. But these classes are configured and introduced to each other through an XML file. This XML file describes how to configure the classes, known as the Spring configuration file. |
|
| 44. |
What Is Web Module? |
|
Answer» This module is built on the application context module, providing a context that is APPROPRIATE for web-based applications. This module also CONTAINS support for several web-oriented tasks such as transparently handling MULTIPART requests for file uploads and programmatic binding of request parameters to your business OBJECTS. It also contains integration support with Jakarta Struts. This module is built on the application context module, providing a context that is appropriate for web-based applications. This module also contains support for several web-oriented tasks such as transparently handling multipart requests for file uploads and programmatic binding of request parameters to your business objects. It also contains integration support with Jakarta Struts. |
|
| 45. |
What Are Object/relational Mapping Integration Module? |
|
Answer» Spring also supports for using of an object/relational mapping (ORM) tool over straight JDBC by providing the ORM module. Spring provide support to tie into SEVERAL popular ORM frameworks, including Hibernate, JDO, and iBATIS SQL Maps. Springs transaction MANAGEMENT supports each of these ORM frameworks as well as JDBC. Spring also supports for using of an object/relational mapping (ORM) tool over straight JDBC by providing the ORM module. Spring provide support to tie into several popular ORM frameworks, including Hibernate, JDO, and iBATIS SQL Maps. Springs transaction management supports each of these ORM frameworks as well as JDBC. |
|
| 46. |
What Is Jdbc Abstraction And Dao Module? |
|
Answer» Using this module we can keep up the DATABASE CODE clean and simple, and prevent problems that result from a failure to close database resources. A new layer of meaningful exceptions on top of the error messages given by several database servers is bought in this module. In addition, this module USES Springs AOP module to provide transaction MANAGEMENT services for objects in a Spring application. Using this module we can keep up the database code clean and simple, and prevent problems that result from a failure to close database resources. A new layer of meaningful exceptions on top of the error messages given by several database servers is bought in this module. In addition, this module uses Springs AOP module to provide transaction management services for objects in a Spring application. |
|
| 47. |
What Is Application Context Module? |
|
Answer» The Application context module makes spring a framework. This module extends the concept of BeanFactory, providing support for internationalization (I18N) messages, application LIFECYCLE events, and validation. This module also supplies many enterprise SERVICES such JNDI access, EJB integration, remoting, and scheduling. It also provides support to other framework. The Application context module makes spring a framework. This module extends the concept of BeanFactory, providing support for internationalization (I18N) messages, application lifecycle events, and validation. This module also supplies many enterprise services such JNDI access, EJB integration, remoting, and scheduling. It also provides support to other framework. |
|
| 48. |
What Is The Core Container Module? |
|
Answer» This MODULE is PROVIDES the fundamental functionality of the spring framework. In this module BeanFactory is the heart of any spring-based application. The entire framework was built on the TOP of this module. This module MAKES the Spring container. This module is provides the fundamental functionality of the spring framework. In this module BeanFactory is the heart of any spring-based application. The entire framework was built on the top of this module. This module makes the Spring container. |
|
| 49. |
What Is Delegatingvariableresolver? |
|
Answer» Spring provides a custom JavaServer Faces VariableResolver IMPLEMENTATION that extends the standard Java Server Faces managed beans mechanism which lets you use JSF and Spring TOGETHER. This VARIABLE RESOLVER is called as DelegatingVariableResolver Spring provides a custom JavaServer Faces VariableResolver implementation that extends the standard Java Server Faces managed beans mechanism which lets you use JSF and Spring together. This variable resolver is called as DelegatingVariableResolver |
|
| 50. |
What Do You Mean By Auto Wiring? |
|
Answer» The Spring container is ABLE to AUTOWIRE relationships between collaborating beans. This means that it is possible to automatically LET Spring resolve collaborators (other beans) for your BEAN by inspecting the contents of the BEANFACTORY. The autowiring functionality has five modes. ► no The Spring container is able to autowire relationships between collaborating beans. This means that it is possible to automatically let Spring resolve collaborators (other beans) for your bean by inspecting the contents of the BeanFactory. The autowiring functionality has five modes. ► no |
|