Showing posts with label spring. Show all posts
Showing posts with label spring. Show all posts
Friday, December 15, 2017
Bean Loading Type In Spring
Bean Loading Type In Spring
Loading the bean which is configured in the Spring-context.xml file, can be done in two ways :
1. Eager loading or Aggressive loading
2. Lazy Loading
1. Eager loading or Aggressive loading
2. Lazy Loading
In the case of Aggressive loading all the beans will be loaded and initialized at container start-up. It is called as eager or aggressive loading because of loading all the bean , instance instantiated and initializing at the container start-up only. We just have to write some configuration in the XML file to indicate container for eager loading. This loading is at the bean level .
To load any bean aggressively we have to mention lazy-init="false" .
Note that this configuration is at the bean level that means if we want to load all the configured bean to load eagerly then have to mention in each bean tag. If not mention then also by default it load eagerly.
Lazy loading
In the case of lazy loading all the beans will be loaded, instantiated and initialized when the container try to use them by calling getBeans() method. We just have to mention lazy-init="true" in order to load the beans lazily.
So bean will be loaded according to the configured lazy-init attribute with its corresponding value , or if not mentioned then by default it load Eagerly.
Note : All bean having singleton scope will follow aggressive loading and all bean with prototype scope will follow lazy loading.
To know more about bean scopes - Click Here
To know more about bean scopes - Click Here
Available link for download
Saturday, October 7, 2017
Betsey Johnson Spring 2010 Fashion Show
Betsey Johnson Spring 2010 Fashion Show
Theres always something so young, fun, and infectious about Betsey Johnsons designs and the Spring 2010 fashion show was no exception. This video of the September 15th, 2009, "Betseys One Night Stand" is a blast. Go Betsey!!
Available link for download
Monday, July 24, 2017
Benefit of using Spring Framework
Benefit of using Spring Framework
- Provide a good programming practice by decoupling the layers.
- If you are using spring in your project it decouples the layers and hence its easy to write the test case for them. So its easy from maintenance point of view.
- Provide convenient API to translate technologies specific(jdbc,hibernate,jdo etc) exception into consistent unchecked exception.
- It provide consistent transaction management interface that can be scale down to local and scale up to global transaction.
- Provide a lightweight IOC container specially if you compare it with EJB containers. So if you are using spring you do not have to worry about server maintenance even you can develop an enterprise application using tomcat only.
- Like EJB provide you the JMS server facility to do the asynchronous transmission Spring is going to provide you Event dispatch functionality that you can use in the replace JMS.
- If you are using spring in your project its easy to integrate with different frameworks like struts, hibernate, toplink etc.
- A well designed spring web MVC framework will provide you a new and better way to write a controller.
- IOC(Inversion of control) will give the facility to decouple the modules and AOP(Aspect oriented programming) that will give you the functionality to add the business layer services and easy to mentaine.
Available link for download
Wednesday, June 7, 2017
Bean Scopes In Spring
Bean Scopes In Spring
Bean instance created by spring container can be in one of the following scopes.
Singleton : When bean scope is singleton only one instance will be created for that bean and the same instance will be returned when you call getBean() method. Singleton is the default scope in ApplicationContext container. When scope of bean is singleton than default loading type is aggressive loading.- Singleton
- Prototype
- Request
- Session
- Global-Session
Prototype : When bean scope is prototype then new instance will be created for that bean when you call getBean() method. When scope is prototype the default loading type is lazy loading.
Request : Request scope is equal to HttpServletRequest in web application it means for every new request a new instance will be created.
Session : Session scope is equal to HttpSession scope in web application. It means for new instance per user.
Global-Session : Global-Session scope is equals to session in portlet based web application.
Available link for download
Subscribe to:
Posts (Atom)