25 lines
592 B
Markdown
Raw Permalink Normal View History

2015-11-14 17:38:35 +08:00
---
title: Twin
2021-09-12 13:27:23 +03:00
category: Structural
language: en
2015-12-28 15:52:44 +02:00
tags:
- Extensibility
2015-11-14 17:38:35 +08:00
---
## Intent
Twin pattern is a design pattern which provides a standard solution to simulate multiple
2015-11-14 17:38:35 +08:00
inheritance in java
## Class diagram
2015-11-14 17:38:35 +08:00
![alt text](./etc/twin.png "Twin")
## Applicability
Use the Twin idiom when
2015-11-14 17:38:35 +08:00
* To simulate multiple inheritance in a language that does not support this feature.
* To avoid certain problems of multiple inheritance such as name clashes.
## Credits
2015-12-28 15:52:44 +02:00
* [Twin A Design Pattern for Modeling Multiple Inheritance](http://www.ssw.uni-linz.ac.at/Research/Papers/Moe99/Paper.pdf)