How to design a Fluent Interface(randypatterson.com)

submitted by rpattersonrpatterson(745) 4 years, 4 months ago

How to design Fluent Interfaces and why it's important to know about this pattern.

7 comments |category: |Views: 321

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by crpietschmanncrpietschmann(11.3k) 4 years, 4 months ago 0

Here's a small example I wrote up of using the Fluent Interface pattern in a class that generates Sql query statements: http://pietschsoft.com/Blog/Post.aspx?PostID=1403

Reply

posted by powerrushpowerrush(3873) 4 years, 4 months ago 0

WOW, that example code (Order.AddFreeShipping().IncludeItem(10).SetQuantity(2);) at the top of this article looks a lot like the Fluent Interface (order.AddFreeShipping().IncludeItem(15).SuppressTax();) in my article "How to build a Fluent Interface in C#" @ http://www.dotnetkicks.com/csharp/How_to_build_a_Fluent_Interface_in_C.

And the author didn't even give me an acknowledgement.

Reply

posted by powerrushpowerrush(3873) 4 years, 4 months ago 0

Actually make that http://www.dotnetkicks.com/csharp/How_to_build_a_Fluent_Interface_in_C (the RegEx ate the period at the end of my sentence).

Reply

posted by gavinjoycegavinjoyce(25.7k) 4 years, 4 months ago 0

"(the RegEx ate the period at the end of my sentence)"

Sounds like a great excuse to join the DNK project team and add a unit test for this ;)

Here is the test as it is : http://dotnetkicks.googlecode.com/svn/trunk/DotNetKicks/Incremental.Kick.Tests/HelperTests/TextHelperTests.cs

Reply

posted by powerrushpowerrush(3873) 4 years, 4 months ago 0

Well, actually, I didn't necessarily think of it as a bug, because I'm not even sure that the URL RFC disallows a period at the end.

I've considered helping out with the DNK project, but as quick as you (and the others) are at new feature releases, I'm not sure I'm as experienced or dedicated. :-)

BTW, MbUnit's RowTest rocks!

Reply

posted by gavinjoycegavinjoyce(25.7k) 4 years, 4 months ago 0

I don't think I've ever seen a URL end with a '.'.

Regardless of what the RFC potentially says, I think that we should not allow a '.' at the end of a URL.

Reply

posted by gavinjoycegavinjoyce(25.7k) 4 years, 4 months ago 0

Here is the RFC : http://www.ietf.org/rfc/rfc1738.txt

Reply

information Login or create an account to comment on this story