Talk:Mixin: Difference between revisions
Line 47: | Line 47: | ||
I also removed ColdFusion. Again, like PHP, it does not have multiple inheritances so how can mixins work? [[User:Cburnett|Cburnett]] 23:35, 27 June 2007 (UTC) |
I also removed ColdFusion. Again, like PHP, it does not have multiple inheritances so how can mixins work? [[User:Cburnett|Cburnett]] 23:35, 27 June 2007 (UTC) |
||
:Did you know that using of mixins is also possible in languages that support only single inheritance? Take a look at Ruby or Java. Ruby uses modules for that purpose (http://www.rubycentral.com/book/tut_modules.html) and Java leverages the power of Aspect-oriented programming (as someone noticed in Commentary section). |
Revision as of 10:07, 7 July 2007
Computer science Start‑class High‑importance | |||||||||||||||||
|
Confusing analogy
The bowl and ingredient analogy is confusing— Preceding unsigned comment added by 141.154.250.176 (talk • contribs) 14:53, 2 June 2004 (UTC)
Are mixins bad?
I always wondered: are Mixin's "bad"? I'm sure the proper answer is that they're useful in some scenarios, but detrimental in others. What should I look out for? What are similar paradigms that get mistakenly used as Mixin's? I don't want to suffer from Golden hammer syndrome, if there's something that answers the problem better... --Eddie Parker 13:19, 2 May 2005 (UTC)
Flavors
Link to Flavors needs a substantive page.— Preceding unsigned comment added by 217.43.207.44 (talk • contribs) 22:42, 18 June 2005 (UTC)
Error in "Comentary"
Inheritance can indeed be used to refactor common behavior, so mixins are just another way of getting the same functionality, AFAIK. (*)
Well, CLOS generic functions allow multiple dispatching, but I don't know if this has something to do with mixins... Maybe it cannot be donne (except for the trick in Visitor) with the other sintax?
(*) Mixins add the benefit of being suitable for some aspect-oriented programming. This is because they can refactor methods from classes that have nothing in common (so it would be a bad practice to make them inherit from a common base). This is also true with the very similar way of ArtScript for defining class attributes. Anyway I wonder wether the benefits of AOP which mixins bring couldn't be reached using multiple inheritance...
Example
Could someone familiar with this concept provide a simple code example? John (Jwy) 18:22, 1 April 2006 (UTC)
- I added one for python. Cburnett 03:35, 26 June 2007 (UTC)
Misleading and incomplete
I've just accidentically stumbled into this article, and I get the severe feeling that it is misleading and incomplete. Most importantly it doesn't really give substantial information, what a mixin is. Then, it is too fixated on specific programming languages. Using mixins is a a programming style, which by and large can be used in nearly every programming language. Just google for Mixin+C++ to get a hint. E.g. Smaragdakis and Batory.
I only have time for this notice right now, but I'll have a try at the article in the future.
Pjacobi 12:30, 12 April 2006 (UTC)
Definition and implementation - Missing Javascript
Given the popularity of Javascript, it should probably get added to the list of languages that use Mixin for object creation. In Javascript, you define the class and add the methods afterwards. You can add methods new at runtime. data64 17:59, 24 September 2006 (UTC)
- Um, javascript doesn't have classes. The best you can do is is copy in methods from another object but you have to do that manually. Cburnett 03:22, 26 June 2007 (UTC)
PHP and ColdFusion
I removed PHP. How can you have mixins in PHP when PHP only has single inheritance? That gives you no room to "mix in" the mixin class. The best you can do is declare a class as abstract and inherit from there, but how can that be a "mixin"? Cburnett 03:20, 26 June 2007 (UTC)
I also removed ColdFusion. Again, like PHP, it does not have multiple inheritances so how can mixins work? Cburnett 23:35, 27 June 2007 (UTC)
- Did you know that using of mixins is also possible in languages that support only single inheritance? Take a look at Ruby or Java. Ruby uses modules for that purpose (http://www.rubycentral.com/book/tut_modules.html) and Java leverages the power of Aspect-oriented programming (as someone noticed in Commentary section).