I'll show you several types of fluent interfaces, starting with method chaining.
我会向您展示几种连贯接口,首先是方法链接。
When used together with method chaining, these functions allow complex operations to look simple.
如果配合方法链接(method chaining)一起使用,这些函数可以使复杂的操作看上去非常简单。
Method chaining USES return values from methods to relay instruction context, which in this case is the object instance making the first method invocation.
方法链接使用方法的返回值来中转指令上下文,在这种情况下是进行第一个方法调用的对象实例。
Method chaining works best for the creation of simple data objects, yet here I'm using it both for the setter methods on Appointment and in AppointmentCalendar to start the method chain.
方法链接对于简单数据对象的创建最有效,但是这里我同时为Appointment上和AppointmentCalendar中的setter方法启用方法链接。
Method chaining works best for the creation of simple data objects, yet here I'm using it both for the setter methods on Appointment and in AppointmentCalendar to start the method chain.
方法链接对于简单数据对象的创建最有效,但是这里我同时为Appointment上和AppointmentCalendar中的setter方法启用方法链接。
应用推荐