Class using only common functions. Why is that bad?

I have a class called MemberhipHelper that I use in my ASP.NET project. It looks like this:

Public Class MembershipHelper

    Public Shared Function IsMultiStoreUser() As Boolean
     return Roles.IsUserInRole(....)
    End Function

    Public Shared Function IsAdmin() As Boolean
     return Roles.IsUserInRole(....)
    End Function

    Public Shared Function IsReaderOnly() As Boolean
     return Roles.IsUserInRole(....)
    End Function

End Class

I read somewhere that it’s nice to have a class with only shared functions, but I don’t remember where.

Why is it bad and how can I improve it?

thanks

+3
source share
2 answers

From the name you used for your functions, it seems that all functions describe the user's properties (for example, whether the user is an administrator).

**, IRole.

** , . - .

+3

, , , .

, , , , , Helper/Extension.

+2

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


All Articles