Skip to content

Should TargetingContext be sealed? #486

Open

Description

No description provided.

Activity

  1. jimmyca15 commented on Aug 2, 2024

    @jimmyca15
    Member

    Yes, it should've been sealed given there was no intent to use it as a base class. However, sealing it now would be a breaking change that I don't believe we have a reason to take.

  2. zhiyuanliang-ms commented on Aug 5, 2024

    @zhiyuanliang-ms
    MemberAuthor

    Jimmy Campbell (@jimmyca15)
    In v4 major version bump, we can have breaking change. I don't think there will be anyone inherit TargetingContext. So, v4 is a good chance for us to make it sealed.

  3. jimmyca15 commented on Aug 5, 2024

    @jimmyca15
    Member

    I don't think there will be anyone

    But we never know.

  4. zhiyuanliang-ms commented on Aug 15, 2024

    @zhiyuanliang-ms
    MemberAuthor

    Discussed offline. Will not take the breaking change in v4

  5. WeihanLi commented on Aug 19, 2024

    @WeihanLi
    Contributor

    For public class types, think we could always start with sealed types if applicable since change a type from sealed to non-sealed would not be a breaking change, for internal types, maybe we could enable the CA1852 analyzer rule in the editorconfig file to help enforce the sealed internal types rule

    [*.{cs,vb}]
    dotnet_diagnostic.CA1852.severity = none
    

    https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1852
    https://github.com/microsoft/FeatureManagement-Dotnet/blob/main/.editorconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions