A "Fluent Interface" to XML!
I've been getting into this kick on fluent interfaces, and recently posted a blog post about fluent interfaces using XML as an example. Here's a snippet from my post:
string result = FluentInterfaceForXml
.Element("root")
.WithNode("person")
.WithAttribute("firstName", "Timothy")
.WithAttribute("lastName", "Khouri")
It makes me wonder if Microsoft will start developing fluent interfaces for some of their existing technologies? (possibly in a seperate DLL like Enterprise Library). Do any of you developers out there see yourslef writing your own alternate API's in this sort of "human language-esq", method-chaining style?
Check out the blog post - I've included a screen shot of the results and the full source code for the project to show how I did it: http://www.singingeels.com/Blogs/Nullable/2008/07/18/Fluent_Interfaces_to_XML_My_Example_of_Fluent_Interfaces.aspx