静的型付け言語の潜在開発生産性は今の100倍
■ このスレッドは過去ログ倉庫に格納されています
0002デフォルトの名無しさん
2013/03/03(日) 18:27:44.07このやり方でDIとして不十分だと思ってるのはなんだい?
Martin fowlerの話を読む限り問題は無さそうだが?
"依存排除側"
object := DI type1 new.
object := DI type2 typeWithValue:0.
DI type3
subclass:#type
instanceVariable:''
classVariable:''
poolDictionary:''
category:'Independency'.
"依存注入側"
DI type1: Integer.
DI type2: TypeForIntegerFactory.
DI type3: Integer.
"或いは"
delegate := Factory new.
DI type1: delegate.
"別解としてClass辞書を直接書き換えてしまう"
OldType := Type1.
System classDictionary replaceClass: #Type1 ToClass: #Integer.
■ このスレッドは過去ログ倉庫に格納されています