{"id":7873,"date":"2013-09-17T10:31:23","date_gmt":"2013-09-17T15:31:23","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=7873"},"modified":"2013-09-19T16:13:15","modified_gmt":"2013-09-19T21:13:15","slug":"fcmodel","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2013\/09\/17\/fcmodel\/","title":{"rendered":"FCModel"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/marcoarment\/FCModel\">Marco Arment<\/a>:<\/p>\n<blockquote cite=\"https:\/\/github.com\/marcoarment\/FCModel\"><p>FCModel is a generic model layer on top of FMDB. It&rsquo;s intended for people who want <em>some<\/em> of Core Data&rsquo;s convenience, but with more control over implementation, performance, database schemas, queries, indexes, and migrations, and the ability to use raw SQL queries and SQLite features directly.<\/p>\n<p>FCModel accomplishes a lot of what <a href=\"http:\/\/www.objc.io\/issue-4\/SQLite-instead-of-core-data.html\">Brent Simmons wrote about<\/a>. This is my version of that.<\/p><\/blockquote>\n<p>It&rsquo;s a basic object mapper that supports uniquing\/caching but not relationships. Unlike Core Data, the objects can be modified from any thread.<\/p>\n<p>I think Core Data is OK as far as it goes but that it needs an &ldquo;escape hatch&rdquo; to do more database-style operations. In other words, instead of having to drop Core Data entirely, you would stay with the framework but forego certain object niceties that don&rsquo;t work well with those commands.<\/p>\n<p>Update (2013-09-19): <a href=\"http:\/\/collindonnell.com\/2013\/09\/17\/fcmodel-and-current-thoughts-on-core-data\/\">Collin Donnell<\/a>:<\/p>\n<blockquote cite=\"http:\/\/collindonnell.com\/2013\/09\/17\/fcmodel-and-current-thoughts-on-core-data\/\"><p>The truth is that because Core Data is a general solution which completely abstracts you away from the idea of using a database, I&rsquo;m not sure there&rsquo;s anyway that it couldn&rsquo;t be a bit complex in places and that there wouldn&rsquo;t be walls to bump up against. In my experience with Core Data everything works great except when it doesn&rsquo;t, and because you&rsquo;re so abstracted away from the implementation detail of it using a SQLite store, when you do hit those walls, you hit them <em>hard<\/em>.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Marco Arment: FCModel is a generic model layer on top of FMDB. It&rsquo;s intended for people who want some of Core Data&rsquo;s convenience, but with more control over implementation, performance, database schemas, queries, indexes, and migrations, and the ability to use raw SQL queries and SQLite features directly. FCModel accomplishes a lot of what Brent [&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":[109,594,54,74,71,425],"class_list":["post-7873","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-coredata","tag-fmdb","tag-objective-c","tag-opensource","tag-programming","tag-sqlite"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7873","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=7873"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7873\/revisions"}],"predecessor-version":[{"id":7908,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7873\/revisions\/7908"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=7873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=7873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=7873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}