This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes definition of mixin interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "definition of mixin interface" Watch "definition of mixin interface" New topic

definition of mixin interface

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hi Folks,

please throw some light on mixin interface. basically what is the different between interface and mixin interface ?
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 917

wikipedia wrote:In object-oriented programming languages, a mixin is a class that provides a certain functionality to be inherited by a subclass, while not meant for instantiation (the generation of objects of that class). Inheriting from a mixin is not a form of specialization but is rather a means of collecting functionality. A class may inherit most or all of its functionality from one or more mixins through multiple inheritance.

wikipedia wrote:... Some of the functionality of mixins is provided by interfaces in popular languages like Java and C#. However, an interface only specifies what the class must support and cannot provide an implementation. Another class, providing an implementation and dependent with the interface, is needed for refactoring common behavior into a single place. ...


My Website: [] Cool your mind:[] My Sally:[]
Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

It's the first time I see this term. Wikipedia helps.

[My Blog]
All roads lead to JavaRanch
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167

A simple Google gave me Mixin

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

thank you all
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167

Three links to the same wikipedia page in almost a minute!
How about that!
Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

Definition from Effective Java
a mixin is a type that a class can implement in addition to its “primary type” to declare that it provides some optional behavior. For example, Comparable is a mixin interface that allows a class to declare that its instances are ordered with respect to other mutually comparable objects. Such an interface is called a mixin because it allows the optional functionality to be “mixed in” to the type’s primary functionality.
jQuery in Action, 2nd edition
subject: definition of mixin interface
Similar Threads
mixin extending custom node
library handiness compared to groovy?
What is Mixin Classes in JavaFX?
Multiple inheritance doubt