Skip to content

Commit

Permalink
Merge branch 'release/0.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
zen committed Dec 3, 2014
2 parents 1d6dd07 + a7f67d5 commit 1c24c46
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 20 deletions.
4 changes: 2 additions & 2 deletions FastEasyMapping.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |spec|
spec.name = 'FastEasyMapping'
spec.version = '0.5.0'
spec.version = '0.5.1'
spec.summary = 'Fast mapping from JSON to NSObject / NSManagedObject and back'
spec.homepage = "https://github.com/Yalantis/FastEasyMapping"
spec.license = { :type => 'MIT', :file => 'LICENSE' }
spec.author = { 'Dmitriy Zen' => '[email protected]' }
spec.source = { :git => 'https://github.com/Yalantis/FastEasyMapping.git', :tag => '0.5.0' }
spec.source = { :git => 'https://github.com/Yalantis/FastEasyMapping.git', :tag => '0.5.1' }

spec.requires_arc = true
spec.ios.deployment_target = '7.0'
Expand Down
8 changes: 8 additions & 0 deletions FastEasyMapping.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
1D6A33C795E9CA3D388DC1CE /* FEMMergeableCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D6A33C793CC8D51633186DC /* FEMMergeableCollection.m */; };
1D6A34C84E523B5F58F87C5E /* PersonWithMissingRelationships.json in Resources */ = {isa = PBXBuildFile; fileRef = 1D6A34832F9D9655B8006CA7 /* PersonWithMissingRelationships.json */; };
1D6A370F588D1C2F011CAAD0 /* PersonWithCar_2.json in Resources */ = {isa = PBXBuildFile; fileRef = 1D6A3466BDE4D4241DCB93D3 /* PersonWithCar_2.json */; };
1D6A37C793D545632C8A850E /* FEMRelationshipMapping.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D6A3CDC5401F7A121CDBE70 /* FEMRelationshipMapping.h */; };
1D6A39844172720B32A975F4 /* FEMCacheSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D6A3936AEC2DF329B7D5C0C /* FEMCacheSpec.m */; };
1D6A3B04DDB373C1542E785F /* PersonWithNullRelationships.json in Resources */ = {isa = PBXBuildFile; fileRef = 1D6A3A47A8DEF276ECDCDF46 /* PersonWithNullRelationships.json */; };
1D6A3BE38C286BBE0A0B0FEA /* FEMExcludableCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D6A3BDA3CA0DDFF256CDB49 /* FEMExcludableCollection.m */; };
1D6A3C550D3AE60BEF5051D7 /* FEMAttributeMappingSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D6A334CB9A14401554BDA18 /* FEMAttributeMappingSpec.m */; };
1D6A3CA9D3524975D1940D9F /* FEMAttributeMapping.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D6A37509AEB445D0EE5964D /* FEMAttributeMapping.h */; };
1D6A3D32342A71CC6BCA3855 /* Person_2.json in Resources */ = {isa = PBXBuildFile; fileRef = 1D6A3ACBBC8E66609F169E94 /* Person_2.json */; };
1D6A3EB013A2AC7B8B7B69CE /* PersonWithCar_1.json in Resources */ = {isa = PBXBuildFile; fileRef = 1D6A3E2CCF90DF3444D0707E /* PersonWithCar_1.json */; };
2C11898E18D07356005D8D91 /* FEMManagedObjectMapping.h in Headers */ = {isa = PBXBuildFile; fileRef = 69ED7EA48925307F4DB06848 /* FEMManagedObjectMapping.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -124,13 +126,15 @@
1D6A3466BDE4D4241DCB93D3 /* PersonWithCar_2.json */ = {isa = PBXFileReference; lastKnownFileType = file.json; path = PersonWithCar_2.json; sourceTree = "<group>"; };
1D6A34832F9D9655B8006CA7 /* PersonWithMissingRelationships.json */ = {isa = PBXFileReference; lastKnownFileType = file.json; path = PersonWithMissingRelationships.json; sourceTree = "<group>"; };
1D6A368ADA05F6A09F22A3AC /* FEMMergeableCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FEMMergeableCollection.h; sourceTree = "<group>"; };
1D6A37509AEB445D0EE5964D /* FEMAttributeMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FEMAttributeMapping.h; sourceTree = "<group>"; };
1D6A3936AEC2DF329B7D5C0C /* FEMCacheSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FEMCacheSpec.m; sourceTree = "<group>"; };
1D6A3A47A8DEF276ECDCDF46 /* PersonWithNullRelationships.json */ = {isa = PBXFileReference; lastKnownFileType = file.json; path = PersonWithNullRelationships.json; sourceTree = "<group>"; };
1D6A3ACBBC8E66609F169E94 /* Person_2.json */ = {isa = PBXFileReference; lastKnownFileType = file.json; path = Person_2.json; sourceTree = "<group>"; };
1D6A3AF6BD6EABAAACD8D4B8 /* FEMExcludableCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FEMExcludableCollection.h; sourceTree = "<group>"; };
1D6A3BDA3CA0DDFF256CDB49 /* FEMExcludableCollection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FEMExcludableCollection.m; sourceTree = "<group>"; };
1D6A3C137E92421E8D0A5E41 /* FEMAssignmentPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FEMAssignmentPolicy.m; sourceTree = "<group>"; };
1D6A3CA591E94D2729ED3DA0 /* FEMAssignmentPolicyMetadata.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FEMAssignmentPolicyMetadata.m; sourceTree = "<group>"; };
1D6A3CDC5401F7A121CDBE70 /* FEMRelationshipMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FEMRelationshipMapping.h; sourceTree = "<group>"; };
1D6A3DEA59A87E175360FBFC /* FEMAssignmentPolicyMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FEMAssignmentPolicyMetadata.h; sourceTree = "<group>"; };
1D6A3E2CCF90DF3444D0707E /* PersonWithCar_1.json */ = {isa = PBXFileReference; lastKnownFileType = file.json; path = PersonWithCar_1.json; sourceTree = "<group>"; };
1D6A3E68C0FB99F7A73DE0C5 /* FEMAssignmentPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FEMAssignmentPolicy.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -441,6 +445,7 @@
children = (
69ED7C1A1592194E312212F9 /* FEMRelationship.h */,
69ED757758DA67B4E8247495 /* FEMRelationship.m */,
1D6A3CDC5401F7A121CDBE70 /* FEMRelationshipMapping.h */,
);
path = Relationship;
sourceTree = "<group>";
Expand Down Expand Up @@ -523,6 +528,7 @@
69ED7141C706CAC006EADE5A /* FEMAttribute.m */,
69ED7539B5509DF9599396EA /* FEMAttribute+Extension.h */,
69ED718D4E6F950EE17E08C6 /* FEMAttribute+Extension.m */,
1D6A37509AEB445D0EE5964D /* FEMAttributeMapping.h */,
);
path = Attribute;
sourceTree = "<group>";
Expand Down Expand Up @@ -592,6 +598,8 @@
69ED72338B6419101B1C8CDB /* NSObject+FEMKVCExtension.h in Headers */,
69ED702FCEC21C111D4518AC /* FEMProperty.h in Headers */,
69ED7191763B8C717620B63E /* FEMMapping.h in Headers */,
1D6A3CA9D3524975D1940D9F /* FEMAttributeMapping.h in Headers */,
1D6A37C793D545632C8A850E /* FEMRelationshipMapping.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
4 changes: 0 additions & 4 deletions FastEasyMapping/Source/Core/Mapping/Attribute/FEMAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
#import "FEMProperty.h"
#import "FEMTypes.h"

@class FEMAttribute;

@compatibility_alias FEMAttributeMapping FEMAttribute;

@interface FEMAttribute : NSObject <FEMProperty>

- (id)mapValue:(id)value;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// FEMAttributeMapping.h
// FastEasyMapping
//
// Created by zen on 03/12/14.
// Copyright (c) 2014 Yalantis. All rights reserved.
//

#import "FEMAttribute.h"

/**
* @discussion
* FEMAttributeMapping has been renamed to FEMAttribute
*/
@compatibility_alias FEMAttributeMapping FEMAttribute;
2 changes: 2 additions & 0 deletions FastEasyMapping/Source/Core/Mapping/FEMMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
#import <Foundation/Foundation.h>

#import "FEMAttribute.h"
#import "FEMAttributeMapping.h"
#import "FEMRelationship.h"
#import "FEMRelationshipMapping.h"

@interface FEMMapping : NSObject {
@protected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
#import "FEMProperty.h"
#import "FEMAssignmentPolicy.h"

@class FEMMapping, FEMRelationship;

@compatibility_alias FEMRelationshipMapping FEMRelationship;
@class FEMMapping;

@interface FEMRelationship : NSObject <FEMProperty>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// FEMRelationshipMapping.h
// FastEasyMapping
//
// Created by zen on 03/12/14.
// Copyright (c) 2014 Yalantis. All rights reserved.
//

#import "FEMRelationship.h"

/**
* @discussion
* FEMRelationshipMapping has been renamed to FEMRelationship
*/
@compatibility_alias FEMRelationshipMapping FEMRelationship;
3 changes: 3 additions & 0 deletions FastEasyMapping/Source/FastEasyMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

#import "FEMProperty.h"
#import "FEMAttribute.h"
#import "FEMAttributeMapping.h"

#import "FEMRelationship.h"
#import "FEMRelationshipMapping.h"

#import "FEMMapping.h"
#import "FEMObjectMapping.h"
Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This is fork of [EasyMapping](https://github.com/lucasmedeirosleite/EasyMapping) - flexible and easy way of JSON mapping.

## Reason to be
It turns out, that almost all popular libraries for JSON mapping SLOW. The main reason is often trips to database during lookup of existing objects. So we [decided](http://yalantis.com/blog/2014/03/17/from-json-to-core-data-fast-and-effectively/) to take already existing [flexible solution](https://github.com/lucasmedeirosleite/EasyMapping) and improve overall performance.
It turns out, that almost all popular libraries for JSON mapping SLOW. The main reason is often trips to database during lookup of existing objects. So we [decided](http://yalantis.com/blog/2014/03/17/from-json-to-core-data-fast-and-effectively/) to take already existing [flexible solution](https://github.com/lucasmedeirosleite/EasyMapping) and improve overall performance.
<p align="center" >
<img src="https://raw.githubusercontent.com/Yalantis/FastEasyMapping/efabb88b0831c7ece88e728b9665edc4d3af5b1f/Assets/performance.png" alt="FastEasyMapping" title="FastEasyMapping">
</p>
Expand Down Expand Up @@ -67,8 +67,8 @@ Mapping can be described in next way:
return [FEMManagedObjectMapping mappingForEntityName:@"Person" configuration:^(FEMManagedObjectMapping *mapping) {
[mapping setPrimaryKey:@"personID"]; // object uniquing

[mapping addAttributeMappingDictionary:@{@"personID": @"id"}];
[mapping addAttributeMappingFromArray:@[@"name", @"email", @"gender"]];
[mapping addAttributesFromDictionary:@{@"personID": @"id"}];
[mapping addAttributesFromArray:@[@"name", @"email", @"gender"]];

[mapping addRelationshipMapping:[self carMapping] forProperty:@"car" keyPath:@"car"];
[mapping addToManyRelationshipMapping:[self phoneMapping] forProperty:@"phones" keyPath:@"phones"];
Expand All @@ -79,14 +79,14 @@ Mapping can be described in next way:
return [FEMManagedObjectMapping mappingForEntityName:@"Car" configuration:^(FEMManagedObjectMapping *mapping) {
[mapping setPrimaryKey:@"carID"];

[mapping addAttributeMappingFromArray:@[@"model", @"year"]];
[mapping addAttributesFromArray:@[@"model", @"year"]];
}];
}

+ (FEMManagedObjectMapping *)phoneMapping {
return [FEMManagedObjectMapping mappingForEntityName:@"Phone" configuration:^(FEMManagedObjectMapping *mapping) {
[mapping addAttributeMappingDictionary:@{@"phoneID" : @"id"}];
[mapping addAttributeMappingFromArray:@[@"number", @"ddd", @"ddi"]];
[mapping addAttributesFromDictionary:@{@"phoneID" : @"id"}];
[mapping addAttributesFromArray:@[@"number", @"ddd", @"ddi"]];
}];
}

Expand All @@ -100,7 +100,7 @@ Converting a NSDictionary or NSArray to a object class or collection now becomes
Person *person = [FEMManagedObjectDeserializer deserializeObjectExternalRepresentation:externalRepresentation
usingMapping:[MappingProvider personMapping]
context:context];
NSArray *cars = [FEMManagedObjectDeserializer deserializeCollectionExternalRepresentation:externalRepresentation
usingMapping:[MappingProvider carMapping]
context:moc];
Expand All @@ -118,7 +118,7 @@ FEMManagedObjectMapping *mapping = [MappingProvider personMapping];
### Assignment Policy
Now relationship can use one of three predefined assignment policies: `FEMAssignmentPolicyAssign`, `FEMAssignmentPolicyMerge` and `FEMAssignmentPolicyReplace`.
Now relationship can use one of three predefined assignment policies: `FEMAssignmentPolicyAssign`, `FEMAssignmentPolicyMerge` and `FEMAssignmentPolicyReplace`.
## Deserialization. NSObject
Expand All @@ -135,6 +135,10 @@ NSArray *collectionRepresentation = [FEMSerializer serializeCollection:cars usin

# Changelog

### 0.5.1
- Rename [FEMAttributeMapping](https://github.com/Yalantis/FastEasyMapping/blob/release/0.5.1/FastEasyMapping/Source/Core/Mapping/Attribute/FEMAttributeMapping.h) to [FEMAttribute](https://github.com/Yalantis/FastEasyMapping/blob/release/0.5.1/FastEasyMapping/Source/Core/Mapping/Attribute/FEMAttribute.h), [FEMRelationshipMapping](https://github.com/Yalantis/FastEasyMapping/blob/release/0.5.1/FastEasyMapping/Source/Core/Mapping/Relationship/FEMRelationshipMapping.h) to [FEMRelationship](https://github.com/Yalantis/FastEasyMapping/blob/release/0.5.1/FastEasyMapping/Source/Core/Mapping/Relationship/FEMRelationship.h)
- [Shorten FEMMapping mutation methods](https://github.com/Yalantis/FastEasyMapping/blob/release/0.5.1/FastEasyMapping/Source/Core/Mapping/FEMMapping.h#42)

### 0.4.1
- Resolves: [#19](https://github.com/Yalantis/FastEasyMapping/issues/19), [#18](https://github.com/Yalantis/FastEasyMapping/issues/18), [#16](https://github.com/Yalantis/FastEasyMapping/issues/16), [#12](https://github.com/Yalantis/FastEasyMapping/issues/12)
- Add Specs for AttributeMapping
Expand All @@ -154,7 +158,7 @@ NSArray *collectionRepresentation = [FEMSerializer serializeCollection:cars usin

### 0.3.2
- Fix [handling of nil-relationship](https://github.com/Yalantis/FastEasyMapping/issues/7) data during deserialization
- Remove compiler warnings
- Remove compiler warnings

### 0.3.1
- Set deployment target to 6.0
Expand All @@ -165,7 +169,7 @@ NSArray *collectionRepresentation = [FEMSerializer serializeCollection:cars usin
- Add assignment policy support for FEMManagedObjectDeserializer: Assign, Merge, Replace
- Cover FEMCache by tests

### 0.2.1
### 0.2.1
- Improved types introspection by @advantis

### 0.2.0
Expand All @@ -178,7 +182,7 @@ NSArray *collectionRepresentation = [FEMSerializer serializeCollection:cars usin
- Fixed caching behaviour for new objects

### 0.1
- Added managed objects cache for deserialization
- Added managed objects cache for deserialization

# Thanks
* Special thanks to [lucasmedeirosleite](https://github.com/lucasmedeirosleite) for amazing framework.
Expand Down

0 comments on commit 1c24c46

Please sign in to comment.