{"id":13154,"date":"2015-12-20T14:19:02","date_gmt":"2015-12-20T19:19:02","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=13154"},"modified":"2015-12-22T00:01:49","modified_gmt":"2015-12-22T05:01:49","slug":"mvvm-is-not-very-good","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/12\/20\/mvvm-is-not-very-good\/","title":{"rendered":"MVVM Is Not Very Good"},"content":{"rendered":"<p><a href=\"http:\/\/khanlou.com\/2015\/12\/mvvm-is-not-very-good\/\">Soroush Khanlou<\/a>:<\/p>\n<blockquote cite=\"http:\/\/khanlou.com\/2015\/12\/mvvm-is-not-very-good\/\"><p>Nobody has any idea what the words &ldquo;view model&rdquo; mean, and so they can&rsquo;t agree on what to put in them. The concept itself is too abstract. None of these writers would disagree about what goes in a Validator class, or a Presenter class, or a Fetcher class, and so on. Those are all better names with tightly defined roles.<\/p><p>Giving the same name to a wide variety of different objects with drastically different responsibilities only serves to confuse readers. If we can&rsquo;t agree view models should do, what&rsquo;s the benefit to giving them all the same name?<\/p><\/blockquote>\n\n<p>Update (2015-12-21): <a href=\"https:\/\/ashfurrow.com\/blog\/mvvm-is-exceptionally-ok\/\">Ash Furrow<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=10773824\">comments<\/a>):<\/p>\n<blockquote cite=\"https:\/\/ashfurrow.com\/blog\/mvvm-is-exceptionally-ok\/\"><p>Next, does MVVM encourage objects that have many responsibilities? Sure, I guess it does. But again, the alternative that most iOS developers are familiar with is a massive view controller. So compared to MVC, MVVM is just telling you to use objects with one <em>fewer<\/em> responsibilities, which is a step in the right direction!<\/p>\n<p>[&#8230;]<\/p>\n<p>I argue that moving to MVVM (keeping the existing app structure, plus view models) is <em>still<\/em> a great idea. Separating as much code from the view layer as possible makes it <em>way<\/em> easier to further factor those components into smaller-yet objects.<\/p>\n<\/blockquote>\n\n<p><a href=\"http:\/\/nearthespeedoflight.com\/article\/2015_12_21_mvvm_is_not_good_and_not_mvvm_is_good\">Jason Brennan<\/a>:<\/p>\n<blockquote cite=\"http:\/\/nearthespeedoflight.com\/article\/2015_12_21_mvvm_is_not_good_and_not_mvvm_is_good\"><p>Both articles, I think, are really arguing the same things, but maybe from different directions[&#8230;]<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Soroush Khanlou: Nobody has any idea what the words &ldquo;view model&rdquo; mean, and so they can&rsquo;t agree on what to put in them. The concept itself is too abstract. None of these writers would disagree about what goes in a Validator class, or a Presenter class, or a Fetcher class, and so on. Those are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[27,373,71],"class_list":["post-13154","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-craft","tag-mvvm","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=13154"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13154\/revisions"}],"predecessor-version":[{"id":13169,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13154\/revisions\/13169"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=13154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=13154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=13154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}