jQuery 中方法链中使用的设计模式的名称是什么?
What is the name of the design pattern used in method chaining in jQuery?
jQuery 中方法链背后的设计模式的名称是什么?
示例:$( "p" ).css( "color", "red" ).find( ".special" ).css( "color", "green" );
根据这个 post https://softwareengineering.stackexchange.com/questions/137999/what-is-the-pattern-name-for-using-method-chaining-to-build-an-object,它被称为 Fluent Interface。
我看到很多文章也将它简单地称为 方法链接 (这似乎更具描述性)以及 链接模式 。似乎你搜索得越多,你就能找到越多不同的名字,尽管有很多关于 "fluent interface".
这个词的引用
jQuery 中方法链背后的设计模式的名称是什么?
示例:$( "p" ).css( "color", "red" ).find( ".special" ).css( "color", "green" );
根据这个 post https://softwareengineering.stackexchange.com/questions/137999/what-is-the-pattern-name-for-using-method-chaining-to-build-an-object,它被称为 Fluent Interface。
我看到很多文章也将它简单地称为 方法链接 (这似乎更具描述性)以及 链接模式 。似乎你搜索得越多,你就能找到越多不同的名字,尽管有很多关于 "fluent interface".
这个词的引用