Why would I use static methods for database access

前端 未结 4 1446
滥情空心
滥情空心 2020-12-16 20:16

So I came across this issues today and I couldn\'t find some meaningful explanation is there some non-subjective reason to use static methods when it comes to database inter

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-16 21:05

    We very rarely use them here in our company, although they can serve a purpose in utility classes or things of the sort that are simply calling functions. Depending on how many instances you would expect of a non-static class, they can also affect performance., but that would need to be a notable instance difference.

    source - MSDN

提交回复
热议问题