Adapterパターン
ラッパーパターンとも呼ばれる。
基本的な委譲の使い方。
「既に提供されているもの」と「必要なもの」の差を埋めるパターン。
class Adapter{ private ITarget target; public Adapter(ITarget target) { //メンバにセット } public getAdaptValue(){ //targetを操作して求める操作を行う。 } } interface ITarget{ int getIntValue(); String getStringValue(); } class TargetAAA : ITarget{ //実装クラス } class TargetBBB : ITarget{ //実装クラス }