{"id":677,"date":"2006-01-19T00:00:00","date_gmt":"2006-01-18T23:00:00","guid":{"rendered":"https:\/\/wwwneu.strehle.de\/tim\/weblog\/archives\/2006\/01\/19\/615\/"},"modified":"2006-01-19T00:00:00","modified_gmt":"2006-01-18T23:00:00","slug":"615","status":"publish","type":"post","link":"https:\/\/www.strehle.de\/tim\/weblog\/archives\/2006\/01\/19\/615\/","title":{"rendered":"MVC and web apps: oil and water"},"content":{"rendered":"<p>Harry Fuecks at SitePoint &#8211; <a href=\"http:\/\/www.sitepoint.com\/blogs\/2005\/12\/22\/mvc-and-web-apps-oil-and-water\/\" title=\"SitePoint Blogs \u00bb MVC and web apps: oil and water\">MVC and web apps: oil and water<\/a>:<\/p>\n<p>&#8222;CRUD is defined in the context of databases where what you\u2019re dealing with is sets of information\u2014you need to make a distinction between inserting into the set and updating an existing member of the set.<\/p>\n<p>Meanwhile HTTP was designed for access to resources, the \u201cprimary key\u201d being determined by it\u2019s URL (vs. having to worry about the insert id). If you think \u201cdocuments\u201d, it\u2019s clear there\u2019s no need to make a distinction between creating and updating\u2014creating a document results in the first version. Updating means overwriting an existing document with a new version. But in both cases the client is POSTing the same thing and does not need to be aware of whether the document already existed or not.<\/p>\n<p>[&#8230;] Perhaps our websites have been driven too far by the database? The point here is, given the mismatch between HTTP and CRUD, we\u2019ve put CRUD first which in turns makes actions first class in our frameworks. We aim to support N different types of action (verbs) when really we should have been dealing with only three\u2014GET, POST and DELETE (the latter being perhaps re-routed to a specific \u201cresource class\u201d method according to some framework \/ form conventions).&#8220;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Harry Fuecks at SitePoint &#8211; MVC and web apps: oil and water: &#8222;CRUD is defined in the context of databases where what you\u2019re dealing with is sets of information\u2014you need to make a distinction between inserting into the set and updating an existing member of the set. Meanwhile HTTP was designed for access to resources, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_share_on_mastodon":"0"},"categories":[1],"tags":[],"class_list":["post-677","post","type-post","status-publish","format-standard","hentry","category-weblog"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/posts\/677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/comments?post=677"}],"version-history":[{"count":0,"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/posts\/677\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/media?parent=677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/categories?post=677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/tags?post=677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}