オブジェクト設計&デザパタ
■ このスレッドは過去ログ倉庫に格納されています
0682デフォルトの名無しさん
2011/12/05(月) 22:01:48.87自分もAdapterでどちらを使うかと言われれば委譲の方を使うよ
ただし同じAdapterパターンなんだから委譲も継承も目的は同じはず
en wiki
>translates one interface for a class into a compatible interface
>>678のサイト
>Convert the interface of a class into another interface clients expect.
>Adapter lets classes work together, that could not otherwise because of incompatible interfaces.
と書いてあるとおりインターフェースを合わせるためのもの
プログラムとか考えずアダプターと言ったらまさしくインターフェースを合わせるためのもの
Listenerでmodelを呼び出すのは、インターフェースを合わせるためではないよね
>>681
ソースなんてGoF読んでくれとしか言えないw
■ このスレッドは過去ログ倉庫に格納されています