2 users responded in this post

Subscribe to this post comment rss or trackback url
User Gravatar
Andrey Shchekin said in September 27th, 2007 at 9:00 pm

Good post.
The only thing missing is an implicit cast from PFI to Person, to write it like
Person person = new Person().Set.FirstName("Pat").LastName("Frank").Age(30).IsActive();

Also, personally, I find ‘With’ more readable than ‘Set’ for these cases.

C# 3.0 object initializers will obsolete this usage, but until then it is quite cool.

User Gravatar
Kalpesh said in October 1st, 2007 at 4:57 am

Good post to introduce fluent interfaces.
Isn’t this already present in c++ (remember cout << … << …)

Also, VB has this already with..end with
I also like what Andrey has to say abt c#3.0 thing

Thanks.

Leave A Reply

 Username (Required)

 Email Address (Remains Private)

 Website (Optional)