问题
I want to know what is the name of the design pattern behind method chaining in jQuery?
回答1:
According to this post https://softwareengineering.stackexchange.com/questions/137999/what-is-the-pattern-name-for-using-method-chaining-to-build-an-object, it's called a Fluent Interface.
I see many articles referring to it simply as method chaining also (which seems more descriptive) and also the Chaining Pattern. It seems the more you search, the more different names you can find, though there are many references to the term "fluent interface".
来源:https://stackoverflow.com/questions/28955571/what-is-the-name-of-the-design-pattern-used-in-method-chaining-in-jquery