Why is QualificationDataAttribute sealed?

Jan 19, 2010 at 9:46 PM

I am wondering why the QualificationDataAttribute is sealed.  If this were not a sealed class, I could implement the following as part of a framework which would lead to better code readability:

    public static class IsolationLevel
    {
        public const string IsolationType = "Isolation";

        public const string ProcessIsolation = "NewProcess";
        public const string AppDomainIsolation = "NewAppDomain";
    }

    public class ProcessIsolationAttribute : System.AddIn.Pipeline.QualificationDataAttribute
    {
        public ProcessIsolationAttribute()
            : base(IsolationLevel.IsolationType, IsolationLevel.ProcessIsolation)
        {
        }
    }

    [System.AddIn.AddIn("My AddIn")]
    [ProcessIsolation]
    public class MyAddin : IAddin
    {
    }
Feb 10, 2010 at 12:56 AM

Attributes are typically sealed for performance reasons - see the documentation for CA1813 for a bit more information.