Mixins first appeared in Symbolics's object-oriented Flavors system (developed by Howard Cannon), which was an approach to object-orientation used in Lisp Machine Lisp. This pattern is an example of enforcing the dependency inversion principle. A mixin can also be viewed as an interface with implemented methods. Mixins encourage code reuse and can be used to avoid the inheritance ambiguity that multiple inheritance can cause (the " diamond problem"), or to work around lack of support for multiple inheritance in a language. Mixins are sometimes described as being "included" rather than "inherited". How those other classes gain access to the mixin's methods depends on the language. In object-oriented programming languages, a mixin (or mix-in) is a class that contains methods for use by other classes without having to be the parent class of those other classes. This article is about the programming concept.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |