Why use custom scope in spring? When it is necessary?

Can someone help me in understanding the custom area. I went through the manual and through many online examples and realized how it is implemented. But I still do not quite understand why we need our own proxy server, and why we will go, limiting the volume of bean.

As I know, for singleton we use singleton when we want one bean to be provided to all links, and we use a prototype when we want a new bean to be given every time a bean is referenced.

Now my understanding about the user area is Custom Scope - we use the custom area as an intermediate between the two, and we don't want a single link or a new link every time. but then it’s closer to singleton, where we pass the same bean every time, only from our preferred location (for example, the underlying threadlocal or map).

Please help me make my concept clear. The main question is here. Why do I need a custom area? and When is it required?

+5
source share
2 answers

. , bean, . , , , , .

, (, ), , . , , ( ).

+3

. , -. - "" "". . "" ( ) " " ( , ).

.

+4

All Articles