2015-11-14 17:38:35 +08:00
|
|
|
|
---
|
|
|
|
|
layout: pattern
|
|
|
|
|
title: Twin
|
|
|
|
|
folder: twin
|
|
|
|
|
permalink: /patterns/twin/
|
|
|
|
|
categories: Creational
|
|
|
|
|
tags: Java
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
**Intent:** Twin pattern is a design pattern which provides a standard solution to simulate multiple
|
|
|
|
|
inheritance in java
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
**Applicability:** Use the Twin idiom when
|
|
|
|
|
|
|
|
|
|
* to simulate multiple inheritance in a language that does not support this feature.
|
2015-11-16 10:01:03 +08:00
|
|
|
|
* to avoid certain problems of multiple inheritance such as name clashes.
|
|
|
|
|
|
|
|
|
|
**Credits:**
|
|
|
|
|
|
|
|
|
|
* [Twin – A Design Pattern for Modeling Multiple Inheritance](http://www.ssw.uni-linz.ac.at/Research/Papers/Moe99/Paper.pdf)
|