Fluent API Style Usage
- by Chris Dwyer
When programming against a fluent API, I've seen the style mostly like this:
var obj = objectFactory.CreateObject()
.SetObjectParameter(paramName, value)
.SetObjectParameter(paramName, value)
.DoSomeTransformation();
What is the reasoning behind putting the dot at the beginning of the line instead of the end of the line like this:
var obj = objectFactory.CreateObject().
SetObjectParameter(paramName, value).
SetObjectParameter(paramName, value).
DoSomeTransformation();
Or, is it merely a style thing that a team makes a consensus on?