
Show HN: Aspect-oriented mixins in JavaScript - yangmillstheory
https://github.com/yangmillstheory/mixin.a.lot
======
drostie
Very cool. I'm very interested to see what you'll build with it.

With any cross-cutting abstraction like this, it's kind of like developing a
new potting soil: I feel like I need to know what flowers you're trying to
grow to understand why you made the choices you made.

~~~
yangmillstheory
Thanks. I was writing an application that had unrelated components that all
acted like view models.

I looked at existing mixin libraries, but found some that either injected
themselves into the prototype chain or patched Function.prototype to let
mixees customize behavior. I didn't like that, so I thought of this approach.

The rest has been a continuous process of simplification, but I never got back
to writing that old application :).

------
own3r
Nice idea! Here's an alternative which uses ES2016 decorators
[https://github.com/mgechev/aspect.js](https://github.com/mgechev/aspect.js)

~~~
yangmillstheory
Thanks for sharing! Have you studied aspect-oriented programming formally?

I used the term "aspect-oriented" because a co-worker mentioned it and it
seemed appropriate, but I don't have a deep understanding of that philosophy.

I'll take a look at your code, blog posts, and videos later when I get out of
work. :)

------
bricss
It's everything but AOP

~~~
yangmillstheory
yeah, i should probably change that tonight

