{"id":18271808,"url":"https://github.com/crafterm/CoreResource","last_synced_at":"2025-04-05T02:30:43.570Z","repository":{"id":615667,"uuid":"254196","full_name":"crafterm/CoreResource","owner":"crafterm","description":"Experimental Core Data driven active resource/JSON client","archived":false,"fork":false,"pushed_at":"2009-07-18T08:05:25.000Z","size":124,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-05T11:54:16.371Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://github.com/crafterm/Core-Resource","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crafterm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-07-18T07:03:53.000Z","updated_at":"2019-08-13T14:27:03.000Z","dependencies_parsed_at":"2022-07-07T15:40:10.407Z","dependency_job_id":null,"html_url":"https://github.com/crafterm/CoreResource","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crafterm%2FCoreResource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crafterm%2FCoreResource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crafterm%2FCoreResource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crafterm%2FCoreResource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crafterm","download_url":"https://codeload.github.com/crafterm/CoreResource/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247279276,"owners_count":20912856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:39:31.889Z","updated_at":"2025-04-05T02:30:42.963Z","avatar_url":"https://github.com/crafterm.png","language":"Objective-C","readme":"## Core Resource\n\nhttp://github.com/crafterm/CoreResource\n\n### Description\n\nCore Resource is an experimental Core Data backed structured webservice client, useful for consuming data oriented webservices, and communicating with \nRails applications via REST similar to Active Resource for Rails applications.\n\nCore Resource uses Core Data for client side storage of data retrieved from your Rails models, from a JSON or XML feed (ie. an NSArray of structured NSDictionary objects)\nbetween server and client. It supports many model property types (string, int, floats, etc) including associations.\n\nTo use Core Resource, you create a Core Data model that matches your Rails model (ie. the models/entities you wish to send to your client), including associations (ie. relationships\nin Core Data). After generating your Core Data model classes, RABuilder can read a remote JSON or XML stream (essentially an array of dictionaries) and create/populate instances \nof those Core Data model objects with content. When RABuilder encounters a nested dictionary, it assumes it to be an association and recursively builds a new Core Data model\ninstance, associating the child and parent during processing. \n\nIf an existing Core Data model instance exists (identified via an duplicate associated 'id' field) then it's used as-is rather than created, allowing you to build up a local model\nstructure matching your remote structure, including 1-many relationships where the associated object is referenced from many child objects.\n\n### Example\n    // Assume a Core Data model containing Wine, Vineyard and Region entities, and a Rails application with matching model objects with associations\n\n    NSArray * wineJSON = [json JSONValue]; // fetched remotely using RAService, or NSURLRequest directly\n    \n    self.wines = [NSMutableArray array];\n    \n    RABuilder * builder = [[RABuilder alloc] initWithManagedContext:managedObjectContext];\n    \n    for (NSDictionary * wineData in wineJSON) {\n        Wine * wine = [builder create:wineData];\n        [self.wines addObject:wine];\n        [wine release];\n    }\n    \n    [builder release];\n    \n    // self.wines is now a Core Data mode structure that contains all Wine objects from the remote webservice, and can be read including traversing associations, and be persisted\n    \n    for (Wine * wine in self.wines) {\n        NSLog(@\"Wine: %@ (%@) (%@)\", wine.name, wine.vineyard.name, wine.vineyard.region.name);\n    }\n    \nPlease look at the Tests directory for a complete example including the core data model described above, etc.\n\n### Limitations\n\nCore Resource is currently a proof of concept that only supports reading of content (no update or create operations just yet), those operations will be added soon. It also\nrequires that you build a local Core Data model structure following the relationships defined in your remote Rails app - which hence currently works best when you control \nboth server and client. After some more testing and use, I'll definitely be looking to solidify the concepts and make the code more resilient and adaptable.\n\nIf you have any comments, thoughts, feedback or ideas please feel free to contact me at Marcus Crafter \u003ccrafterm@redartisan.com\u003e.\n\n\n### LICENSE:\n\n(The MIT License)\n\nCopyright (c) 2009 Marcus Crafter \u003ccrafterm@redartisan.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrafterm%2FCoreResource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrafterm%2FCoreResource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrafterm%2FCoreResource/lists"}