Comparing Declarative and Imperative Security

Now that you understand how security policy is managed, even if you aren't the person doing the managing, it is important to understand how we make use of code access security in our code. Much of the CLR already interacts with security policy using declarative and imperative security requests. These requests are made in the form of attributes and code that instantiates a specific security-related class. When security requests are made in the form of attributes, this is referred to as declarative security. When security requests are made in the form of lines of code within a method body, this is referred to as imperative security. The results are roughly the same regardless of the method used.

Get Visual Basic® .NET Power Coding now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.