Spring Interview Questions

Spring 4.3.x

  • Whats is Spring Framework?
    • Is a Java platform that provides comprehensive infrastructure support for developing Java applications and Java Enterprise applications.
  • Spring modules Spring is divided into modules, applications can choose which modules they need.
    • Core Container modules:
      • Core:
        • Provides IoC, DI features and fundamental parts of the framework.
      • Bean:
        • The BeanFactory interface provides an advanced configuration mechanism to capable of managing any type of object.
      • Context:
        • Provides the ApplicationContext interface (sub-interface of BeanFactory) adds more enterprise-specific functionality:
          • integration with AOP, provides configuration for an application, load file resources, methods for accessing application components, resolves messages (supporting internationalization).
        • ClassPathXmlApplicationContext, FileSystemApplicationContext and XmlWebApplicationContext are some of the known implementing classes.
      • Expression:
        • Provides the Spring Expression Language (SpEL)
    • Data Access/Integration
      • JDBC
      • ORM
      • OXM
      • JMS
      • Transactions
    • Web
      • Web
      • MVC or Servlet
      • WebSocket
      • Portlet
    • AOP
    • Aspects
    • Instrumentation
    • Messaging
    • Test
  • Inversion of Control (IoC) and Dependency Injection (DI)
    • Dependency Injection is a design pattern to implement the principle of Inversion of Control.
    • Dependency Injection:
      • It is a process whereby objects define their dependencies only through:
        • constructor arguments
        • arguments to a factory method
        • properties that are set on the object instance after it is constructed or returned from a factory method, and then
      • the Spring IoC container injects those dependencies when it instantiates the bean.
  • Bean
    • is an object that that is instantiated, assembled and managed by the Spring IoC Container
  • The Spring IoC Container
    • The interface org.springframework.context.ApplicationContext represents the IoC Container and is responsible for instantiating, configuring, and assembling the beans.
  • How to configure Spring IoC Container? The configuration metadata is provided by:
    • XML-based metadata
    • Annotation-based configuration
    • Java-based configuration. You can define beans external to your application classes by using Java rather than XML files.
  • Q
    • A
  • Q
    • A
  • Q
    • A
  • Q
    • A
  • Q
    • A