mixins

mixins

 英

  • 網絡混入;混合插入;混合類型

例句

Mixins can be instantiated with different parent classes depending on the requirements of a particular context.

根據特定上下文要求可以不同實例化mixin

Mixins are allowed to have parameters, just like components.

混合允許參數組件一樣

By incorporating mixins using generic types, we are able to work around many of the key limitations of other formulations of mixins.

通過使用類型合并mixin我們解決其它mixin公式許多關鍵限制

The reason: both mixins and generic classes can be thought of as functions mapping existing classes to new classes.

原因mixin泛型認為現有映射函數

Nevertheless, it's a very unfortunate restriction because it limits the set of classes eligible to be turned into mixins.

然而仍是一個非常遺憾約束因為限制適合轉換mixin集合

But it is appealing, almost seductive, to incorporate mixins as part of a generic type system.

但是合并mixin作為型類型系統一部分吸引人幾乎可以魅力無窮

Mixins can be viewed as functions mapping existing classes to new subclasses.

mixin視為現有映射函數

The Mixins annotation allows a list of mixing names to be specified.

Mixins標注允許指定一個混合名字列表

Mixins: allow to extract common groups of properties, name them and then include them in selectors.

混合類型允許開發者抽象性質共同點然后命名并且加入選擇器

When mixins are formulated as generic classes, the problem of accidental overrides is particularly nasty.

mixin明確表述泛型意外覆蓋問題特別討厭

With mixins formulated as generic classes, we always have a handle on the parent class, the type parameter that the class extends.

mixin明確表述我們始終句柄繼承類型參數

However, there are other significant difficulties with formulating mixins as generic types.

但是mixin明確表述泛型類型其它一些明顯困難

This can mean generating new objects from a runtime definition or based on mixins of existing types or objects.

可能意味產生物體一個運行基礎定義mixins現有類型對象

Mixins are classes that are parameterized by their parent class.

mixin那些它們參數

Although mixins are simply a design pattern in these languages, there's no reason why they can't be supported at the language level.

盡管mixin只是這些語言一種設計模式語言級別支持它們應該毫無問題

Static members are associated with instantiations of mixins; there are no "shared" static members of mixins.

靜態成員mixin實例化相關沒有共享mixin靜態成員

In the case of mixins as generic types, we can apply the same solution.

mixin作為泛型類型情況我們可以應用同樣解決方案

Thus, in Jam, the visitor pattern can't be used with mixins.

因此Jam訪問者模式不能mixin一起使用

This is where a very useful feature comes in: Mixins.

Ruby一個非常有用特性Mixin可以我們完成方面工作