javier.velez.reyes
Sep 1, 2018 · 1 min read

Hello Yuri. Good post.

First of all you can tell your Javascript “guru” that this kind of approach is known as Traits within the component orientation paradigm [https://goo.gl/w045MT]. Sometimes confused with Mixins they were invented some years ago so please we, the IT community, do not need another strage name for that.

IMHO a more natural use context is within OO where Traits are contextualized when the class is aumented:

```
class Core {
fx () { this.x = 1 }
}
let private = {}
function Trait (ctx) {
return {
fy () { this.y = 1 }.bind (ctx)
}
}
Object.assign (Core.prototype, Trait (private))
```

    javier.velez.reyes

    Written by

    Doctor en informática por la UNED. Especializado en Análisis y Diseño de colaboración. Arquitecto software. Inmerso en Web. Interesado en IT y curioso en todo.