为了使我的代码更有条理,我决定使用流利的接口;然而,通过阅读可用的教程,我发现了许多实现这种流利的方法,其中我发现了一个主题,他说要创建流利的Interface,我们应该使用Interfaces,但他没有提供任何实现它的好细节}Person person = Person.CreateNew().WithName("John").WithAge(21);
但是,我如何才能让Interfaces以更有效的方式创建流畅的
假设我有一个引用的类A' with lot's of methods (which I can't grasp eventually) including a lot of fluent interfaces (including operator overloads) – returning*this` -在以后的API版本中可能会变得更多。
我想继承类B' which has additional (fluent) methods so that all fluent interfaces ofA中的所有东西(我真的不想关心)返回*this引用,因为它们是类