Loading...
Please wait, while we are loading the content...
Similar Documents
Metaclass Composition Using Mixin-Based Inheritance
| Content Provider | Semantic Scholar |
|---|---|
| Author | Bouraqadi, Noury |
| Abstract | In the context of meta-programming and reflective languages, classes can be treated as full fledged objects which are instances of other classes named metaclasses. Metaclasses have proved to be useful for defining new class properties. Examples of such properties are lazy memory allocation, multiple inheritance, having a single instance. . . A class with some property can be obtained by instantiating a metaclass which implements the desired property. However, instantiation allows assigning to a class only properties defined by a single metaclass. A composition mechanism is needed in order to reuse properties defined by different metaclasses and assign them to a given class. This composition should be performed without breaking classmetaclass compatibility. The compatibility issue arises when a class is coupled to its metaclass. So, when composing metaclasses, we need to take care of such coupling in order to avoid run-time exceptions. In this paper, we explore the use of mixin-based inheritance to perform metaclass composition. Mixin-based inheritance is an interesting alternative to both single and multiple inheritance. As opposite to single inheritance, it allows code reuse among different class hierarchies. Contrary to multiple inheritance, it allows developers to explicitly specify the desired behavior through explicit linearisation. Our proposal is to define and compose reusable class properties by introducing mixins at the metaclass level. We demonstrate that this introduction can be done efficiently and without altering compatibility. |
| File Format | PDF HTM / HTML |
| Alternate Webpage(s) | http://csl.ensm-douai.fr/research/uploads/nouryBouraqadi.esug2003ResearchTrack.pdf |
| Alternate Webpage(s) | https://www.researchgate.net/profile/Noury_Bouraqadi/publication/222397135_Safe_metaclass_composition_using_mixin-based_inheritance/links/02e7e53b2f3df8cadb000000.pdf |
| Language | English |
| Access Restriction | Open |
| Content Type | Text |
| Resource Type | Article |