且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery中方法链中使用的设计模式的名称是什么?

更新时间:2023-11-20 20:03:28

根据这篇文章 https:// softengineering.stackexchange.com/questions/137999/what-is-the-pattern-name-for-using-method-chaining-to-build-an-object ,它被称为 Fluent Interface



我看到很多文章只是简单地指向方法链接(似乎更具描述性),还有链接图案即可。看起来你搜索得越多,你可以找到更多不同的名字,尽管有很多关于流畅的界面这个词的引用。


I want to know what is the name of the design pattern behind method chaining in jQuery?

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".