えムナウ Blog

えムナウ の なすがまま

目次

Blog 利用状況

ニュース


follow mnow at http://twitter.com


えムナウのプログラミングのページ

INETAJ

書庫

日記カテゴリ

ギャラリ

わかりやすい MVPVM を実践するために

私の提唱する MVPVM パターンの目的は View と ViewModel の密結合を減らすことにあります。

サンプルは以下のページの Community Open Day 2012 TwitterSample を参照してください。
http://www.mnow.jp/tabid/220/Default.aspx

実装における注意点は以下の通りです。

MVVMパターンからの変更点

View

1)ViewModelからメッセンジャーの通信を受けてビヘイビアを起動する処理を書かない。
 Commandの処理はPresenterが行うのでViewを直接操作できる。

2)DataTemplate の DataType は利用するが、DataTemplateSelector は利用しない。
 ViewModel の派生クラスを使えば DataTemplateSelector を使わずに DataTemplate の DataType で識別できる。

ViewModel

1)Commandの処理を書かない。
 Commandの処理はPresenterが行う。

2)ViewModel は Command も含め、プロパティを View に提供することが主処理となる。

3)コンストラクタ・終了処理は今までの通り書いていいがイベントは生成しない。

4)View と ViewModel 間で完結する入力検証は行っていい。

5)ソート・絞り込みなど ViewModel 内部で完結するデータ操作は行っていい。

Application

1)初期に起動する Presenter を決め プレゼンテーションロジックを書かない。
 プレゼンテーションロジックは Presenter に含む。

2)初期に起動する Presenter の初期処理と終了処理を行う。

Presenter

1)ViewModel の Command を上書きして Command の処理を行う。

2)描画時には Model のデータを取得して ViewModel に設定する。

3)Command の処理で Model を更新し、ViewModel を更新する。

4)子供の Presenter の初期処理と終了処理を行い、描画を指示する。ダイアログは終了をまつ。

 

注意点は一応以上ですが順次追加するかもしれません。
上記 MVVM からの変更点を見ながらサンプルソースを眺めてみてください。

投稿日時 : 2012年6月18日 0:17

コメントを追加

# We are a group of volunteers and opening a new scheme in our community. Your website offered us with valuable information to work on. You have done an impressive job and our entire community will be thankful to you. 2019/11/25 6:11 We are a group of volunteers and opening a new sch

We are a group of volunteers and opening a new scheme in our community.
Your website offered us with valuable information to work on.
You have done an impressive job and our entire community
will be thankful to you.

# Greetings! Very helpful advice in this particular article! It's the little changes which will make the greatest changes. Thanks a lot for sharing! 2019/11/26 19:07 Greetings! Very helpful advice in this particular

Greetings! Very helpful advice in this particular article!
It's the little changes which will make the greatest changes.
Thanks a lot for sharing!

# Greetings! Very helpful advice in this particular article! It's the little changes which will make the greatest changes. Thanks a lot for sharing! 2019/11/26 19:08 Greetings! Very helpful advice in this particular

Greetings! Very helpful advice in this particular article!
It's the little changes which will make the greatest changes.
Thanks a lot for sharing!

# Greetings! Very helpful advice in this particular article! It's the little changes which will make the greatest changes. Thanks a lot for sharing! 2019/11/26 19:09 Greetings! Very helpful advice in this particular

Greetings! Very helpful advice in this particular article!
It's the little changes which will make the greatest changes.
Thanks a lot for sharing!

# Greetings! Very helpful advice in this particular article! It's the little changes which will make the greatest changes. Thanks a lot for sharing! 2019/11/26 19:10 Greetings! Very helpful advice in this particular

Greetings! Very helpful advice in this particular article!
It's the little changes which will make the greatest changes.
Thanks a lot for sharing!

# I am genuinely grateful to the holder of this site who has shared this fantastic piece of writing at here. 2019/11/29 4:56 I am genuinely grateful to the holder of this site

I am genuinely grateful to the holder of this site
who has shared this fantastic piece of writing at here.

# I am genuinely grateful to the holder of this site who has shared this fantastic piece of writing at here. 2019/11/29 4:57 I am genuinely grateful to the holder of this site

I am genuinely grateful to the holder of this site
who has shared this fantastic piece of writing at here.

# I am genuinely grateful to the holder of this site who has shared this fantastic piece of writing at here. 2019/11/29 4:58 I am genuinely grateful to the holder of this site

I am genuinely grateful to the holder of this site
who has shared this fantastic piece of writing at here.

# I am genuinely grateful to the holder of this site who has shared this fantastic piece of writing at here. 2019/11/29 4:59 I am genuinely grateful to the holder of this site

I am genuinely grateful to the holder of this site
who has shared this fantastic piece of writing at here.

# Its not my first time to pay a visit this web page, i am browsing this website dailly and get fastidious facts from here daily. 2019/12/09 21:35 Its not my first time to pay a visit this web page

Its not my first time to pay a visit this web page, i am browsing this
website dailly and get fastidious facts from here daily.

# This post is really a good one it assists new internet users, who are wishing for blogging. 2020/04/04 17:39 This post is really a good one it assists new inte

This post is really a good one it assists new internet users,
who are wishing for blogging.

# Simply desire to say your article is as amazing. The clarity for your publish is just spectacular and i could suppose you're an expert in this subject. Fine with your permission allow me to clutch your feed to stay up to date with impending post. Thanks 2020/05/10 17:32 Simply desire to say your article is as amazing. T

Simply desire to say your article is as amazing. The clarity for your publish is just spectacular
and i could suppose you're an expert in this subject.

Fine with your permission allow me to clutch your feed to stay up to date with impending post.
Thanks a million and please carry on the enjoyable work.

# Highly energetic post, I enjoyed that a lot. Will there be a part 2? 2020/06/16 12:01 Highly energetic post, I enjoyed that a lot. Will

Highly energetic post, I enjoyed that a lot. Will there be a part 2?

# Its like you learn my thoughts! You appear to know so much approximately this, like you wrote the e-book in it or something. I think that you simply can do with a few % to pressure the message house a bit, but instead of that, that is wonderful blog. A 2020/06/26 18:15 Its like you learn my thoughts! You appear to know

Its like you learn my thoughts! You appear to know so much
approximately this, like you wrote the e-book in it or something.
I think that you simply can do with a few % to pressure the message house
a bit, but instead of that, that is wonderful blog.
An excellent read. I'll definitely be back.

タイトル  
名前  
URL
コメント