开发者

What is the requires/provides design pattern used by the T4 RequiresProvidesDirectiveProcessor class?

开发者 https://www.devze.com 2022-12-11 21:52 出处:网络
The MSDN Library documentation for the RequiresProvidesDirectiveProcessor class in the Microsoft.VisualStudio.TextTemplating namespace开发者_JAVA技巧 refers to a design pattern called \"requires/provi

The MSDN Library documentation for the RequiresProvidesDirectiveProcessor class in the Microsoft.VisualStudio.TextTemplating namespace开发者_JAVA技巧 refers to a design pattern called "requires/provides". What is this design pattern?

"The abstract base class for a directive processor that defines and implements a design pattern called requires/provides." - from MSDN Library


The custom directive implementing this pattern looks like this:

<#@ Custom processor="CustomDirectiveProcessor" 
    requires="name=value;name=value" 
    provides="name=value;name=value"  #>

It allows you to package multiple parameters instide of two standard - requires and provides. This pattern is used in directive processors generated by DSL toolkit.

Personally, I haven't found it to be particularly useful. When building a custom directive processor, I think it is clearer to separate each parameter. The amount of effort it takes is the same.

0

精彩评论

暂无评论...
验证码 换一张
取 消