This is a brainstorm. Any comments would be appreciated.
Recently, I noticed several source frameworks with similar patterns.
Moq
mock.Setup(framework => framework.DownloadExists("2.0.0.0"))
.Returns(true)
.AtMostOnce();
Ninject
Bind<IService>().To<RedImpl>().WhenMemberHas<RedAttribute>();
and Free NHibernate
HasManyToMany(x => x.Products)
.Cascade.All()
.Table("StoreProduct");
I noticed that they are all related to some kind of configuration. And itβs more convenient to use compared to the usual property setting configuration.
I can say that I like this style, but I canβt understand why.
Can someone tell me what good it is and when this style will be useful? Also, is there a name for this style? How is this done under the hood? If there is a tutorial on how to write a Moq style, that would be very appreciated.
Update
. , , Fluent Interface, - , Fluent?