Disadvantages of the Context.Current template?

For applications of any size, what are the disadvantages of using the Context.Current template? (i.e., "Current" is a general / static property of the "Context" class that instantiates the first time it is used)

Any advantage of using this template only for generic / static classes / methods?

I ask in the context of .NET, although I think it can be used in different languages.

+3
source share
1 answer

This is a kind of singleton pattern, usually representing a local thread store. A famous example in the .NET world is the HttpContext.

testability. , , , TDD, . ASP.NET MVC , , , .

, , OO, . , DI, , - .

, concurrency. , , , , , "", , .

, . . , .

+5

Source: https://habr.com/ru/post/1714332/


All Articles