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.
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. , , , , , "", , .
, . . , .
Source: https://habr.com/ru/post/1714332/More articles:How to pass bool from C # via C ++ com interface to idl - c ++Easy way to change cents style in money text - cssregex excludes quoted matches for this - javaNVarchar (MAX) for short strings - sqlSending structure using recvfrom () and sendto () - cXamlParseException - Invalid attribute value (...) for Property Property - coding-stylehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1714334/using-sql-statements-to-query-in-memory-objects&usg=ALkJrhijguPHTKLV-WfjK4AAdhY85i4Y3Qhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1714335/how-many-tablessprocsfunctions-in-a-database-is-too-many&usg=ALkJrhgdxD_AvuYteCooX0_AEUqS_GisNgWhat are the options for dynamically typed .NET web development at this time? - .netUsing QueryString as a debug switch? - debuggingAll Articles