0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

MVVMのViewModel橋渡しの何が問題なのか?

Posted at

ViewModelは橋渡しのみを行いロジックを入れないという考えの
問題点を検討してみる。

例)ボタン2度押し防止処理

Modelにボタンイネーブルプロパティを持ちModelが制御する。

問題点
 ボタンはUI固有のものなので、ModelがUI変更の影響を受ける。
 ボタンがないUIもありうる。

ボタン2度押し防止処理はボタンというUIがある事で成り立つ。
UIのための処理である。
UIの処理をModelが持つことはModelがUIに依存していることになる。
UIの変更にModelが影響を受けてしまう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?