Ruby 有没有人用过 composite pattern?

lithium4010 · March 09, 2017 · Last by nouse replied at March 10, 2017 · 1285 hits

   将对象组合成树形结构以表示“整体—部分”的层次结构。Composite 模式使单个对象和组合对象的使用具有一致性

这个模式在实际开发中有什么常见的应用呢?

dom 树、组织架构、文件目录

Ruby 里 include 就是 composite pattern,设计模式已经过时了

You need to Sign in before reply, if you don't have an account, please Sign up first.