Posts

Spring Boot Interview Materials

Image
  Spring Bean Scope There are 5 types of  spring bean  scopes: Singleton  - only one instance of the spring bean will be created for the spring container. This is the default spring bean scope. While using this scope, make sure bean doesn’t have shared instance variables otherwise it might lead to data inconsistency issues.   Prototype  – A new instance will be created every time the bean is requested from the spring container. Request  – This is same as prototype scope, however it’s meant to be used for web applications. A new instance of the bean will be created for each HTTP request. Session  – A new bean will be created for each HTTP session by the container. Global-session  – This is used to create global session beans for Portlet applications Why to use the MVC Pattern? 1) Separation of Concerns -Separation of Concern is one of the core advantages of an MVC Pattern. The MVC pattern provides a clean separation between the UI, Business Logic, Model or Data. On the other hand, we c