Sunday, September 12, 2021

Bean scope-

 By default bean scope is singleton that means every time we get a bean from ioc container will give me the copy of a bean .so beans are the same object.

But if we want to get different beans every time from the ioc container we should use prototype . 

To define a prototype bean we can use @Scope("prototype")/@ConfigurableBeanFactory.SCOP_PROTOTYPE

ex:


No comments:

Post a Comment

Javascript module

JavaScript Modules (ES6) let you split code into multiple files and reuse code cleanly. Main keywords: export → make something available...