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.
| 51. |
Give an example of BeanFactory implementation. |
|
Answer» The most commonly used BeanFactory implementation is the XmlBeanFactory class. This container reads the configuration metadata from an XML file and uses it to create a fully configured system or application. |
|
| 52. |
What are types of IoC containers? Explain them. |
|
Answer» There are two types of IoC containers −
|
|
| 53. |
What is Spring IoC container? |
|
Answer» The Spring IoC creates the objects, wire them together, configure them, and manage their complete lifecycle from creation till destruction. The Spring container uses dependency injection (DI) to manage the components that make up an application. |
|
| 54. |
What is AOP? |
|
Answer» Aspect-oriented programming, or AOP, is a programming technique that allows programmers to modularize crosscutting concerns, or behavior that cuts across the typical divisions of responsibility, such as logging and transaction management. The core construct of AOP is the aspect, which encapsulates behaviors affecting multiple classes into reusable modules. |
|
| 55. |
Which DI would you suggest Constructor-based or setter-based DI? |
|
Answer» Since you can mix both, Constructor- and Setter-based DI, it is a good rule of thumb to use constructor arguments for mandatory dependencies and setters for optional dependencies. Note that the use of a Required annotation on a setter can be used to make setters required dependencies. |
|
| 56. |
What is Spring configuration file? |
|
Answer» Spring configuration file is an XML file. This file contains the classes information and describes how these classes are configured and introduced to each other. |
|
| 57. |
What are benefits of using spring? |
|
Answer» Following is the list of few of the great benefits of using Spring Framework:
|
|
| 58. |
What is Spring? |
|
Answer» Spring is an open source development framework for enterprise Java. The core features of the Spring Framework can be used in developing any Java application, but there are extensions for building web applications on top of the Java EE platform. Spring framework targets to make J2EE development easier to use and promote good programming practice by enabling a POJO-based programming model. |
|