Mach-IIとModel-Glue(続き)
Sean Corfieldが、Mach-IIとModel-Glueに関する記事の続きを書いた。
More thoughts on Mach II and Model-Glue
Mach-II アプリケーションのModel-Glueへの移管でわかったこと。総じてModel-Glueの長所を言及している。
1.event-handlerの定義がMach-IIとModel-Glueで異なる。ちょっと混乱?
Mach-II <event-handler event= ... >
Model-Glue <event-handler name=... >
2.シンタックスの構造化とシンプルなタグ
Mach-II フラットシンタックス、
event-handlersセクション:連続した1行単位のXMLタグevent-handlerセクション
event-mappingセクション
event-argsセクション
notifyセクション
annouceセクション
filterセクションModel-Glue ネステッドシンタックス、
event-handlersセクション:ネストされ、インデントされ構造化されたXMLタグ
broadcastsセクション
messageセクション
viewsセクション
includeセクション
resultsセクション
resultセクション
結果として、Mach-IIと比較して、Model-Glueのほうが、コントロールロジックとプレゼンテーションロジックを明確に分離でき、eventオブジェクトをデータバスとして一貫して使用できる・・・3.リスナー定義数の削減
5.総括:Model-Glueがいい!
Mach-II 25個のListnerCFCs
Model-Glue 6個のControllerCFCs
4.ちょっと困ったこと
notifyセクションとview-pageセクションの組合せで実現できていたビューの結果をMach-IIではビジネスロジック中で使用できていたが、Model-Glueでは代替手段(Cfsavecontent)を使うことでしかできない。
There's no doubt that Model-Glue has benefitted from the experiences of both Mach II and Fusebox but it has also added its own unique elements. Consistency and simplicity are key drivers for Model-Glue which means you sacrifice some power and expressiveness. As always, it's all about tradeoffs and you need to make the choice based on the needs of your project (and, to some extent, your own personal preferences).
コメント