What is Spring?
Bean Scopes.
Prototype - Properties changed in one instance won’t affect other instances of that bean
Singleton - Properties changed on a global level
Request - (web service) scope of a single HTTP request
Session - (web service) within a session
GlobalSession - (web service) lifecycle of a global HTTP session
Spring Modules
Spring Web Spring Core Spring Context Spring Data Spring Security Spring AOP Spring MVC
Spring bean lifecycle
What is the Spring Container?
IOC Container
Application Context
Bean Factory
ApplicationContext vs BeanFactory.
Bean Factory - no longer in use; lazy initialization for beans (created upon request)
ApplicationContext - supports Spring’s newer modules; eager initialization for beans (can also tell it to do lazy initialization); includes new features such as messaging
Inversion of Control.
Types of Dependency Injection
Constructor and setter
Different types of Bean wiring.
manual or autowiring
Types of autowiring?
byName and byType
How do I create a bean in the container?
@Autowired.
Marks a constructor, field, setter method or config method as to be autowired by Spring's dependency injection facilities. Only one constructor (at max) of any given bean class may carry this annotation, indicating the constructor to autowire when used as a Spring bean. Such a constructor does not have to be public.
@Autowired vs @Inject vs @Resource.
What is @RequestMapping?
Marks a method as an endpoint to which a client can connect, where you can specify the request type it will handle and the path of the endpoint.
@controller vs @restcontroller
Rest Controller annotation is the same as Controller annotation, but assuming that @ResponseBody is active by default, so all the json are parsed to java objects
What is AOP?
Cross Cutting Concerns.
-concerns that cut across multiple layers of an application
Aspect
- The combination of Pointcut and Advice
Types of Advice
JoinPoint vs Pointcut.
Transaction propagation strategies