Method Chaining, Fluent Interfaces, and the Finishing Problem
Fluent interfaces have become very popular in C# APIs recently. Martin Fowler presumably coined the term in 2005 and at the time he wrote, “It's not a common style, but one we think should be better known”. Fluent interfaces are based on the older concepts of method chaining and method cascading (and the term has actually been misused quite a bit to refer to any type of method chaining), whereby the context of a call is passed through via method return values to the next method in the chain. This can result in a much more readable and concise API, particularly when many or a complex series of options or operations are available.
Brace Style Convention
Most C language descendants and variants use braces to indicate scope, and where there is a possibility for variation there will be as many opinions as programmers as to the “correct” way to do things. There has certainly been more than enough written about where to put an opening brace, but I was having a discussion on this topic recently and just couldn’t resist adding my opinion to the noise.
Using ASP.NET MVC and Razor To Generate PDF Files
From reports to scan sheets, the need to generate PDF files has been present in every line-of-business application I’ve ever worked on. In the past, I’ve used a variety of tools to achieve this such as SQL Server Reporting Services or Telerik Reporting. While these kinds of tools work well enough for generating reports straight from the database, it’s been surprising how few resources exist to aid in generating PDF files from arbitrary data.