mixin被认为是设计模式吗? [英] Is mixin considered a design pattern?

查看:264
本文介绍了mixin被认为是设计模式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

混合是否被认为是设计模式?结构?

解决方案

他们是一种语言功能。 模式与特征不同,它解决了一系列可能以矛盾的方式影响情境的力量。通过存在或不存在的特征往往会使模式解决的力量创建。许多设计模式(Double Dispatch是一个很好的例子)来解决语言限制(在这种情况下,在单个参数中调度方法)。


Are mixins considered a design pattern? Structural?

解决方案

They're a language feature. A "pattern" is different from a feature, in that it resolves a set of forces that may influence a situation in contradictory ways. Features, by their presence or absence, tend to create the forces that patterns resolve. Many design patterns (Double Dispatch is a good example) came about to work around language limitations (in this case method dispatching on a single argument).

这篇关于mixin被认为是设计模式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆