开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜