Commit Graph

23 Commits

Author SHA1 Message Date
Blake Watters
3a8221aa08 Added support for configuring and retrieving object mapping via resource path patterns. 2012-01-20 10:21:19 -05:00
Blake Watters
6abbb34ef0 Introduced mapping contexts support.
Extended RKObjectMappingProvider to store collections of object mappings for different use cases. The framework
now stores object mappings, serialization mappings, an error mapping and a pagination mapping using the context
support. Contexts can be added to the provider via method calls or extension via a category.
2012-01-20 10:21:19 -05:00
Blake Watters
563f5e909b Updated all example projects to build against the new project. Cleaned up header imports for flattened project structure 2011-12-02 09:26:36 -05:00
Blake Watters
70c73f2981 Fixed issue with order dependence in Core Data connections. fixes #173
Since OM 2.0 connection of relationships happened during the object mapping operation
instead of aggregately at the end of the process. In this commit, we have introduced a lightweight
queue for deferring portions of the mapping operation until a larger aggregate mapping has completed.

The changes are as follows:
* Introduced RKMappingOperationQueue for queueing portions of mapping. This is a synchronous queue modeled off
of NSOperationQueue that does NOT use threading (for Core Data friendliness).
* RKObjectMappingOperation now has a RKMappingOperationQueue queue property that defaults to nil
* RKObjectMappingOperation instances built via RKObjectMapper will has a mapping operation queue
assigned to the property.
* If a queue is present, RKManagedObjectMappingOperation will use it to defer the connection of relationships.
* At the end of an RKObjectMapper process, the mapping operation queue used by all mapping operations created
during the process will be executed. This allows all relationships to be connected after all object creation
has completed.

The queue is general purpose, though currently only used for the connection of relationships.
2011-09-20 12:02:50 -04:00
Parker
99250475ad added Apache License headers to all files in ObjectMapping directory 2011-09-07 11:31:01 -04:00
Blake Watters
4e03ba7bef Renamed Polymorphic mapping to dynamic mapping after consulting with the community. Dropped abstract superclass in favor of a RKObjectMappingDefinition protocol. Caught missing cases with dynamic object mapping + targetObject. Updated docs and method signatures to reflect the updates. 2011-07-31 19:37:42 -04:00
Blake Watters
670234b775 Added support for polymorphic object mapping (Github #105, #244). This enables you to dynamically map objects to different destination classes or using different mapping strategies via configuration or callbacks. See Docs/Object Mapping.md for details.
Other changes include:
* Eliminated the RKObjectFactory protocol and implementations. Object mapping instances themselves are
now responsible for instantiating target objects for mapping.
* Introduced RKObjectAbstractMapping superclass for RKObjectMapping and RKObjectPolymorphicMapping.
* Updated example applications to use block object loaders (RKTwitter and RKTwitterCoreData)
* Refactored method signatures of RKObjectMapper, RKObjectMapping, and RKObjectMappingProvider to reflect the
existence of abstract mapping types. This was necessary to make polymorphic mappings integrate cleanly.
* Fixed overlap in RestKit error domains between network and object mapping. fixes #208
2011-07-30 16:00:36 -04:00
Blake Watters
f3c0995d5e Implementation of Object Mapping 2.0 design:
* Removed RestKit from inheritance hierarchy
  * Mappings are implemented as concrete classes
  * Mapper is much more flexible & powerful
  * Much more robust error handling
  * Serialization is reimplemented as an object mapping operation
  * Added ability to serialize to JSON natively
  * Reworked Core Data integration
  * Simplified the codebase substantially
2011-06-11 19:26:56 -04:00
Andrew Newdel
bbce5abfd4 Use the keyPath property to map a subset of the response for a single target object. 2011-04-21 19:24:41 -04:00
Robert McNally
b7df8e1f0a Eliminate use of 'class' in method signatures. It is a reserved word in Objective-C++. Replaced with 'objectClass'. fixes #58 2011-04-19 14:22:04 -04:00
Blake Watters
9af6a59c79 Initial implementation of documentation generation using the Appledoc parser. refs #48
* Cleaned up various mismatches in method signatures that were preventing documentation generation
* Removed naked ampersands from comments as they cause XML parser failures during docset generation via appledoc
2011-04-14 22:55:58 -04:00
Blake Watters
88a1b013fc Merge remote branch 'origin/0.9' into core-data-cleanup
Conflicts:
	Code/CoreData/CoreData.h
	Code/CoreData/RKManagedObjectStore.h
	Code/CoreData/RKManagedObjectStore.m
	Code/CoreData/RKObjectSeeder.h
	Code/CoreData/RKObjectSeeder.m
	Code/ObjectMapping/RKObjectLoader.m
	Code/ObjectMapping/RKObjectManager.m
	Code/ObjectMapping/RKObjectMapper.m
	RestKit.xcodeproj/project.pbxproj
2011-03-19 21:26:13 -04:00
Blake Watters
e03c6d3d10 Fixed crash during dealloc of RKClient due to initialization of baseURL observer using a blank host. Updated the object mapper to support class/keypath when loading a single object. Some updates to the UISpec harness to get things working again. 2011-02-25 14:42:50 -05:00
Blake Watters
0ea0a9b6d9 Cleaning up some TODO's and such 2011-02-13 02:59:37 -05:00
Blake Watters
b9e4f57fb0 Work in progress factoring Core Data dependencies out of the Object Mapping layer 2011-02-13 01:19:37 -05:00
Jeremy Ellison
6a5ee2af7e Revert "Remove per-file copyrights"
This reverts commit 91e7c6bb5e.
2011-01-12 15:27:19 -05:00
Jeremy Ellison
91e7c6bb5e Remove per-file copyrights 2011-01-12 15:05:22 -05:00
Blake Watters
8fc71f0fb0 Introduced new missing element mapping policy for controlling whether or not nil values will be set for missing elements from payloads. 2011-01-03 15:31:24 -05:00
Blake Watters
2fbdfb9c37 Work in progress 2010-10-19 14:27:17 -04:00
Jeremy Ellison
7c01d54fa3 Add configurable error parsing to the object mapper. 2010-10-14 12:51:12 -04:00
Blake Watters
b71a85416a Cleaned up warnings and initialization of the request used by the object loader 2010-10-12 14:59:40 -04:00
Blake Watters
46e2308ed1 Fix warning when compiling the seeder 2010-10-01 14:49:05 -04:00
Blake Watters
bd93d43f94 Finished split into more logical components. Library now copies Headers to Build/RestKit and you can selectively link against the components your app needs. libRestKit.a contains everything from the core library. 2010-10-01 13:02:24 -04:00