stampit-org / stampit

OOP is better with stamps: Composable object factories.
https://stampit.js.org
MIT License
3.02k stars 102 forks source link

📚 Stamps vs Traits vs Mixins vs Has-a/Is-a composition vs Multiple inheritance (classes) feature-by-feature comparison #341

Open dwiyatci opened 5 years ago

dwiyatci commented 5 years ago

It's been ¬5 years I've got acquainted with stamps, been visiting the GitHub repo and using them once in a while in my project. ;) That said, I still feel shaky/undecided sometimes whether it's the best approach out there to do composition in OOP. Okay, one of the "Fun with Stamps" articles claims that this could be the most superior:

Classic class-based OOP is rather limiting of what you can and cannot do with your classes. It has certain rules about how the inheritance works. They are set and unchangeable. TraitsJS and mixins are the same — more flexible though, but limited.

Stamps are free. No limits of what you can compose.

Yet, there is no clear feature-by-feature comparison between the contenders:

I think it would be fascinating to see a fair and rather non-biased feature-by-feature comparison matrix/table (maybe like in https://webpack.js.org/comparison/ (?)) to mark a cool legacy in software engineering for the human race has ever been invented here.

Bless! :)

koresar commented 5 years ago

This is an amazing idea! I need some time to work this all out. Thank you.

PS: feel free to drop more ideas.

tmikaeld commented 5 years ago

I've been reading Elliotts latest book and got interested in Composition and thus Stampit. I've been wanting to use it in projects but have a nagging feeling that I'll get into trouble, get locked in or not be able to find a solution to problems I might encounter in bigger projects.

I think this type of comparison would convert a lot of doubters, superb idea and really nicely formulated :-)

StephaneTy-Pro commented 2 years ago

Superb idea, really need those types of comparisons to better understand the whole thing.