0

Today I tried to make some fluent interface for my OpenXml Spreadsheet Cell. And I wrote this one: http://pastebin.com/64dZ8ji7

This could be used as:

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

My question is in next. Does that code from the pastebin the good way to write such things fluently? Or maybe do we have some best practices / commonly accepted guidelines for this? How to find out whether your interface is fluent enough?

Any thoughts on this?

Akim Khalilov
  • 1,019
  • 4
  • 16
  • 31

1 Answers1

0

You should check-out the StyleCop project 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.

I am very content with the guidelines StyleCop enforces.

Raxr
  • 965
  • 7
  • 12
  • I think, StyleCop is the analyzer, but I need some other advice. Does the syntax is well formed for human. Is it enough fluent or it could be more native? – Akim Khalilov Sep 17 '12 at 08:25
  • The guidelines created by Microsoft are exactly for human readability, that is the reason they make those conventions and analyzing tools. – Raxr Sep 17 '12 at 12:09