new StringBuffer("start").append("more").append("more")
Obviously the return statement of the append method should look like
return this;
Later I came across more interesting examples of this in the mock libraries like below.
Expect.Call(someObj.someMethod()).Return(anotherObject).Repeat().Once();
Look at this now.
"Create a new bug on build 45576 with description "this is really bugging ....".
new Bug("new one").onBuild(45576)
.
withDescription("this is really bugging")
.WithPriority("medium").reportedBy("QA")
and this
bug = new Bug("new one");
bug.setDescription("....");
bug.setBuild(45576)......
We can improve the readability by adding 'And', 'With', 'To' etc.
Below I have added a creational method and used 'and' method to
improve the readability a bit more.
Bug.CreateWithTitle("new one").onBuild(45576)
.withDescription("this is really bugging")
.WithPriority("medium")
.reportedBy("QA").and().assignTo("a dev")...
Subscribe to Post Comments [Atom]
I am passionate about making Better Software Solutions,that helps businesses to stay agile, by applying Agile,Lean and Systems Thinking principles. Also I grow coffee,spices and in general has big interest in pesticide free food!
Subscribe to
Posts [Atom]