.NET Fluent代码设计最佳实践

时间:2012-07-30 16:55:39

标签: .net fluent fluent-interface

今天我尝试为我的OpenXml Spreadsheet Cell制作一些流畅的界面。我写了这个:http://pastebin.com/64dZ8ji7

这可以用作:

var newCell = _cell.For.Column(1).For.Row(1).WithContent("Hello").Create();

接下来是我的问题。来自pastebin的代码是否能够流畅地编写这些东西的好方法?或者我们可能有一些最佳实践/普遍接受的指导方针吗?如何确定您的界面是否足够流畅?

对此有何想法?

1 个答案:

答案 0 :(得分:0)

您应该签出StyleCop项目StyleCop on CodePlex

StyleCop analyzes C# source code to enforce a set of style and consistency rules. It can be run from inside of Visual Studio or integrated into an MSBuild project. StyleCop has also been integrated into many third-party development tools.

我对StyleCop强制执行的指导方针非常满意。