Skip to content
This repository
Browse code

Reverted PonsoTest to version on rentzsch/master

  • Loading branch information...
commit 25b700a355065756ac6135db323937bbb508d044 1 parent 29b5156
Tyrone authored December 01, 2011

Showing 14 changed files with 283 additions and 631 deletions. Show diff stats Hide diff stats

  1. 3  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/PonsoTest.xcodeproj/project.pbxproj
  2. 1  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/Model.h
  3. 14  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelAssistant.h
  4. 142  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelAssistant.m
  5. 22  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelCompany.h
  6. 175  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelCompany.m
  7. 18  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartment.h
  8. 163  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartment.m
  9. 8  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartmentAssistant.h
  10. 99  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartmentAssistant.m
  11. 8  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartmentEmployee.h
  12. 99  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartmentEmployee.m
  13. 14  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelEmployee.h
  14. 148  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelEmployee.m
3  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/PonsoTest.xcodeproj/project.pbxproj
@@ -188,7 +188,6 @@
188 188
 		457C267F1399FAC600BF00DD /* Project object */ = {
189 189
 			isa = PBXProject;
190 190
 			attributes = {
191  
-				LastUpgradeCheck = 0420;
192 191
 				ORGANIZATIONNAME = "@nzhuk";
193 192
 			};
194 193
 			buildConfigurationList = 457C26821399FAC600BF00DD /* Build configuration list for PBXProject "PonsoTest" */;
@@ -220,7 +219,7 @@
220 219
 			);
221 220
 			runOnlyForDeploymentPostprocessing = 0;
222 221
 			shellPath = /bin/sh;
223  
-			shellScript = "### Settings\n\nDATA_MODEL_FILE=\"$PROJECT_DIR/MyModel.xcdatamodeld/MyModel.xcdatamodel\"\nDATA_MODEL_SOURCE_DIR=\"$PROJECT_DIR/Sources/DataModel\"\n\nBASE_CLASS=\"ModelObject\"\nAGGREGATE_HEADER=\"$DATA_MODEL_SOURCE_DIR/Model.h\"\n\nMOGENERATOR_DIR=\"$PROJECT_DIR/../../../../../\"\nMOGENERATOR_BIN=`type -P mogenerator` ## Adjust this so that it points to a compiled mogenerator binary.\nMOGENERATOR_TEMPLATES=\"$MOGENERATOR_DIR/contributed templates/Nikita Zhuk/ponso/templates/NSSet/NSCoding\"\n\n### Logic\n\nsource \"$MOGENERATOR_DIR/ponso/generate.sh\"\n";
  222
+			shellScript = "### Settings\n\nDATA_MODEL_FILE=\"$PROJECT_DIR/MyModel.xcdatamodeld/MyModel.xcdatamodel\"\nDATA_MODEL_SOURCE_DIR=\"$PROJECT_DIR/Sources/DataModel\"\n\nBASE_CLASS=\"ModelObject\"\nAGGREGATE_HEADER=\"$DATA_MODEL_SOURCE_DIR/Model.h\"\n\nMOGENERATOR_DIR=\"$PROJECT_DIR/../../../../../\"\nMOGENERATOR_BIN=\"$MOGENERATOR_DIR/mogenerator\" ## Adjust this so that it points to a compiled mogenerator binary.\nMOGENERATOR_TEMPLATES=\"$MOGENERATOR_DIR/contributed templates/Nikita Zhuk/ponso/templates\"\n\n### Logic\n\nsource \"$MOGENERATOR_DIR/ponso/generate.sh\"\n";
224 223
 		};
225 224
 /* End PBXShellScriptBuildPhase section */
226 225
 
1  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/Model.h
@@ -4,3 +4,4 @@
4 4
 #import "ModelDepartmentAssistant.h"
5 5
 #import "ModelDepartmentEmployee.h"
6 6
 #import "ModelEmployee.h"
  7
+
14  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelAssistant.h
@@ -10,7 +10,6 @@
10 10
 
11 11
 #import <Foundation/Foundation.h>
12 12
 #import "ModelObject.h"
13  
-#import "ModelObject.h"
14 13
 
15 14
 @class ModelEmployee;
16 15
 @class ModelCompany;
@@ -22,7 +21,7 @@
22 21
 @end
23 22
 
24 23
 
25  
-@interface _ModelAssistant : ModelObject <NSCoding>
  24
+@interface _ModelAssistant : ModelObject
26 25
 {
27 26
 	NSDate *birthDate;
28 27
 	NSString *name;
@@ -32,7 +31,7 @@
32 31
 	
33 32
 	ModelCompany *company;
34 33
 	
35  
-	NSSet *departments;
  34
+	NSArray *departments;
36 35
 	
37 36
 }
38 37
 
@@ -43,21 +42,14 @@
43 42
 
44 43
 @property (nonatomic, assign, readwrite) ModelCompany *company;
45 44
 
46  
-@property (nonatomic, retain, readonly) NSSet *departments;
  45
+@property (nonatomic, retain, readonly) NSArray *departments;
47 46
 
48 47
 
49 48
 
50 49
 
51  
-- (void)addDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: (BOOL) setInverse;
52 50
 - (void)addDepartmentsObject:(ModelDepartmentAssistant*)value_;
53 51
 - (void)removeDepartmentsObjects;
54  
-- (void)removeDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: (BOOL) setInverse;
55 52
 - (void)removeDepartmentsObject:(ModelDepartmentAssistant*)value_;
56 53
 
57 54
 
58  
-- (void) setBoss: (ModelEmployee*) boss_ settingInverse: (BOOL) setInverse;
59  
-
60  
-- (void) setCompany: (ModelCompany*) company_ settingInverse: (BOOL) setInverse;
61  
-
62  
-
63 55
 @end
142  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelAssistant.m
@@ -7,70 +7,36 @@
7 7
 // Make changes to ModelAssistant.h instead.
8 8
 //
9 9
 
10  
-
11 10
 #import "_ModelAssistant.h"
12 11
 
13 12
 #import "ModelEmployee.h"
14 13
 #import "ModelCompany.h"
15 14
 #import "ModelDepartmentAssistant.h"
16 15
 
  16
+
17 17
 @interface _ModelAssistant()
18  
-@property (nonatomic, retain, readwrite) NSSet *departments;
  18
+@property (nonatomic, retain, readwrite) NSArray *departments;
  19
+
19 20
 @end
20 21
 
21 22
 /** \ingroup DataModel */
22 23
 
23  
-NS_INLINE NSMutableSet* NonretainingNSMutableSetMake()
24  
-{
25  
-    CFSetCallBacks callbacks = {0, NULL, NULL, CFCopyDescription, CFEqual, CFHash};
26  
-    return [(NSMutableSet*) CFSetCreateMutable(0, 0, &callbacks) autorelease];
27  
-}
28  
-
29 24
 @implementation _ModelAssistant
  25
+
30 26
 - (id)init
31 27
 {
32 28
 	if((self = [super init]))
33 29
 	{
  30
+		
34 31
 	}
35 32
 	
36 33
 	return self;
37 34
 }
38 35
 
39  
-- (id) initWithCoder: (NSCoder*) aDecoder
40  
-{
41  
-    if ([[super class] instancesRespondToSelector: @selector(initWithCoder:)]) {
42  
-        self = [super initWithCoder: aDecoder];
43  
-    } else {
44  
-        self = [super init];
45  
-    }
46  
-    if (self) {
47  
-        self.birthDate = [aDecoder decodeObjectForKey: @"birthDate"];
48  
-        self.name = [aDecoder decodeObjectForKey: @"name"];
49  
-        self.boss = [aDecoder decodeObjectForKey: @"boss"];
50  
-        self.company = [aDecoder decodeObjectForKey: @"company"];
51  
-        {
52  
-            NSSet *set = [aDecoder decodeObjectForKey: @"departments"];
53  
-            NSMutableSet *nonretainingSet = NonretainingNSMutableSetMake();
54  
-	        [nonretainingSet unionSet: set];
55  
-	        self.departments = nonretainingSet;
56  
-	    }
57  
-    }
58  
-    return self;
59  
-}
60  
-
61  
-- (void) encodeWithCoder: (NSCoder*) aCoder
62  
-{
63  
-    [super encodeWithCoder: aCoder];
64  
-    [aCoder encodeObject: self.birthDate forKey: @"birthDate"];
65  
-    [aCoder encodeObject: self.name forKey: @"name"];
66  
-    [aCoder encodeObject: self.boss forKey: @"boss"];
67  
-    [aCoder encodeObject: self.company forKey: @"company"];
68  
-    [aCoder encodeObject: self.departments forKey: @"departments"];
69  
-}
70  
-
71 36
 #pragma mark Scalar values
72 37
 
73 38
 
  39
+
74 40
 #pragma mark Dictionary representation
75 41
 
76 42
 - (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary
@@ -79,6 +45,8 @@ - (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary
79 45
 	{
80 46
 		self.birthDate = [dictionary objectForKey:@"ModelAssistant.birthDate"];
81 47
 		self.name = [dictionary objectForKey:@"ModelAssistant.name"];
  48
+		
  49
+		
82 50
 	}
83 51
 	
84 52
 	return self;
@@ -89,9 +57,21 @@ - (NSDictionary *)dictionaryRepresentation
89 57
 	NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[super dictionaryRepresentation]];
90 58
 	[dict setObjectIfNotNil:self.birthDate forKey:@"ModelAssistant.birthDate"];
91 59
 	[dict setObjectIfNotNil:self.name forKey:@"ModelAssistant.name"];
  60
+	
  61
+	
  62
+	
  63
+	
  64
+	
  65
+	
  66
+	
  67
+	
  68
+	
92 69
 	if([self.departments count] > 0)
93 70
 	{
  71
+		
94 72
 	}
  73
+	
  74
+	
95 75
 	return dict;
96 76
 }
97 77
 
@@ -101,92 +81,49 @@ - (void)awakeFromDictionaryRepresentationInit
101 81
 		return; // awakeFromDictionaryRepresentationInit has been already executed on this object.
102 82
 	
103 83
 	
  84
+
  85
+
  86
+	
  87
+	
104 88
 	[super awakeFromDictionaryRepresentationInit];
105 89
 }
106 90
 
107 91
 #pragma mark Direct access
108 92
 
109  
-- (void)addDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: (BOOL) setInverse
  93
+
  94
+- (void)addDepartmentsObject:(ModelDepartmentAssistant*)value_
110 95
 {
111  
-    if(self.departments == nil)
  96
+	if(self.departments == nil)
112 97
 	{
113  
-	    self.departments = NonretainingNSMutableSetMake();
  98
+		self.departments = [NSMutableArray array];
114 99
 	}
115 100
 		
116  
-	[(NSMutableSet *)self.departments addObject:value_];
117  
-	if (setInverse == YES) {
118  
-	    [value_ setAssistant: (ModelAssistant*)self settingInverse: NO];
119  
-	}
120  
-}
121  
-
122  
-- (void)addDepartmentsObject:(ModelDepartmentAssistant*)value_
123  
-{
124  
-    [self addDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: YES];
  101
+	[(NSMutableArray *)self.departments addObject:value_];
  102
+	value_.assistant = (ModelAssistant*)self;
125 103
 }
126 104
 
127 105
 - (void)removeDepartmentsObjects
128 106
 {
129  
-    self.departments = NonretainingNSMutableSetMake();
130  
-}
131  
-
132  
-- (void)removeDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: (BOOL) setInverse
133  
-{
134  
-    if (setInverse == YES) {
135  
-        [value_ setAssistant: nil settingInverse: NO];
136  
-    }
137  
-    [(NSMutableSet *)self.departments removeObject:value_];
  107
+	self.departments = [NSMutableArray array];
138 108
 }
139 109
 
140 110
 - (void)removeDepartmentsObject:(ModelDepartmentAssistant*)value_
141 111
 {
142  
-    [self removeDepartmentsObject:(ModelDepartmentAssistant*)value_ settingInverse: YES];
143  
-}
144  
-
145  
-- (void) setBoss: (ModelEmployee*) boss_ settingInverse: (BOOL) setInverse
146  
-{
147  
-    if (boss_ == nil && setInverse == YES) {
148  
-        [boss setAssistant: nil settingInverse: NO];
149  
-    }
150  
-    boss = boss_;
151  
-    if (setInverse == YES) {
152  
-        [boss setAssistant: (ModelAssistant*)self settingInverse: NO];
153  
-    }    
  112
+	value_.assistant = nil;
  113
+	[(NSMutableArray *)self.departments removeObject:value_];
154 114
 }
155 115
 
156  
-- (void) setBoss: (ModelEmployee*) boss_
157  
-{
158  
-    [self setBoss: boss_ settingInverse: YES];
159  
-}
160  
-
161  
-- (ModelEmployee*) boss{
162  
-    return boss;
163  
-}
164  
-
165  
-- (void) setCompany: (ModelCompany*) company_ settingInverse: (BOOL) setInverse
166  
-{
167  
-    if (company_ == nil && setInverse == YES) {
168  
-        [company removeAssistantsObject: (ModelAssistant*)self settingInverse: NO];
169  
-    }
170  
-    company = company_;
171  
-    if (setInverse == YES) {
172  
-        [company addAssistantsObject: (ModelAssistant*)self settingInverse: NO];
173  
-    }    
174  
-}
175  
-
176  
-- (void) setCompany: (ModelCompany*) company_
177  
-{
178  
-    [self setCompany: company_ settingInverse: YES];
179  
-}
180  
-
181  
-- (ModelCompany*) company{
182  
-    return company;
183  
-}
184 116
 
185 117
 
186 118
 - (void)dealloc
187 119
 {
188 120
 	self.birthDate = nil;
189 121
 	self.name = nil;
  122
+	
  123
+	self.boss = nil;
  124
+	self.company = nil;
  125
+	self.departments = nil;
  126
+	
190 127
 	[super dealloc];
191 128
 }
192 129
 
@@ -194,6 +131,9 @@ - (void)dealloc
194 131
 
195 132
 @synthesize birthDate;
196 133
 @synthesize name;
  134
+
  135
+@synthesize boss;
  136
+@synthesize company;
197 137
 @synthesize departments;
198 138
 
199 139
 @end
22  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelCompany.h
@@ -10,7 +10,6 @@
10 10
 
11 11
 #import <Foundation/Foundation.h>
12 12
 #import "ModelObject.h"
13  
-#import "ModelObject.h"
14 13
 
15 14
 @class ModelAssistant;
16 15
 @class ModelDepartment;
@@ -22,17 +21,17 @@
22 21
 @end
23 22
 
24 23
 
25  
-@interface _ModelCompany : ModelObject <NSCoding>
  24
+@interface _ModelCompany : ModelObject
26 25
 {
27 26
 	NSString *name;
28 27
 	NSNumber *yearFounded;
29 28
 	
30 29
 	
31  
-	NSSet *assistants;
  30
+	NSArray *assistants;
32 31
 	
33  
-	NSSet *departments;
  32
+	NSArray *departments;
34 33
 	
35  
-	NSSet *employees;
  34
+	NSArray *employees;
36 35
 	
37 36
 }
38 37
 
@@ -40,29 +39,22 @@
40 39
 @property (nonatomic, retain, readwrite) NSNumber *yearFounded;
41 40
 @property (nonatomic, assign, readwrite) int yearFoundedValue;
42 41
 
43  
-@property (nonatomic, retain, readonly) NSSet *assistants;
44  
-@property (nonatomic, retain, readonly) NSSet *departments;
45  
-@property (nonatomic, retain, readonly) NSSet *employees;
  42
+@property (nonatomic, retain, readonly) NSArray *assistants;
  43
+@property (nonatomic, retain, readonly) NSArray *departments;
  44
+@property (nonatomic, retain, readonly) NSArray *employees;
46 45
 
47 46
 
48  
-- (void)addAssistantsObject:(ModelAssistant*)value_ settingInverse: (BOOL) setInverse;
49 47
 - (void)addAssistantsObject:(ModelAssistant*)value_;
50 48
 - (void)removeAssistantsObjects;
51  
-- (void)removeAssistantsObject:(ModelAssistant*)value_ settingInverse: (BOOL) setInverse;
52 49
 - (void)removeAssistantsObject:(ModelAssistant*)value_;
53 50
 
54  
-- (void)addDepartmentsObject:(ModelDepartment*)value_ settingInverse: (BOOL) setInverse;
55 51
 - (void)addDepartmentsObject:(ModelDepartment*)value_;
56 52
 - (void)removeDepartmentsObjects;
57  
-- (void)removeDepartmentsObject:(ModelDepartment*)value_ settingInverse: (BOOL) setInverse;
58 53
 - (void)removeDepartmentsObject:(ModelDepartment*)value_;
59 54
 
60  
-- (void)addEmployeesObject:(ModelEmployee*)value_ settingInverse: (BOOL) setInverse;
61 55
 - (void)addEmployeesObject:(ModelEmployee*)value_;
62 56
 - (void)removeEmployeesObjects;
63  
-- (void)removeEmployeesObject:(ModelEmployee*)value_ settingInverse: (BOOL) setInverse;
64 57
 - (void)removeEmployeesObject:(ModelEmployee*)value_;
65 58
 
66 59
 
67  
-
68 60
 @end
175  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelCompany.m
@@ -7,65 +7,36 @@
7 7
 // Make changes to ModelCompany.h instead.
8 8
 //
9 9
 
10  
-
11 10
 #import "_ModelCompany.h"
12 11
 
13 12
 #import "ModelAssistant.h"
14 13
 #import "ModelDepartment.h"
15 14
 #import "ModelEmployee.h"
16 15
 
  16
+
17 17
 @interface _ModelCompany()
18  
-@property (nonatomic, retain, readwrite) NSSet *assistants;
19  
-@property (nonatomic, retain, readwrite) NSSet *departments;
20  
-@property (nonatomic, retain, readwrite) NSSet *employees;
  18
+@property (nonatomic, retain, readwrite) NSArray *assistants;
  19
+@property (nonatomic, retain, readwrite) NSArray *departments;
  20
+@property (nonatomic, retain, readwrite) NSArray *employees;
  21
+
21 22
 @end
22 23
 
23 24
 /** \ingroup DataModel */
24 25
 
25  
-NS_INLINE NSMutableSet* NonretainingNSMutableSetMake()
26  
-{
27  
-    CFSetCallBacks callbacks = {0, NULL, NULL, CFCopyDescription, CFEqual, CFHash};
28  
-    return [(NSMutableSet*) CFSetCreateMutable(0, 0, &callbacks) autorelease];
29  
-}
30  
-
31 26
 @implementation _ModelCompany
  27
+
32 28
 - (id)init
33 29
 {
34 30
 	if((self = [super init]))
35 31
 	{
  32
+		
36 33
 	}
37 34
 	
38 35
 	return self;
39 36
 }
40 37
 
41  
-- (id) initWithCoder: (NSCoder*) aDecoder
42  
-{
43  
-    if ([[super class] instancesRespondToSelector: @selector(initWithCoder:)]) {
44  
-        self = [super initWithCoder: aDecoder];
45  
-    } else {
46  
-        self = [super init];
47  
-    }
48  
-    if (self) {
49  
-        self.name = [aDecoder decodeObjectForKey: @"name"];
50  
-        self.yearFounded = [aDecoder decodeObjectForKey: @"yearFounded"];
51  
-        self.assistants = [aDecoder decodeObjectForKey: @"assistants"];
52  
-        self.departments = [aDecoder decodeObjectForKey: @"departments"];
53  
-        self.employees = [aDecoder decodeObjectForKey: @"employees"];
54  
-    }
55  
-    return self;
56  
-}
57  
-
58  
-- (void) encodeWithCoder: (NSCoder*) aCoder
59  
-{
60  
-    [super encodeWithCoder: aCoder];
61  
-    [aCoder encodeObject: self.name forKey: @"name"];
62  
-    [aCoder encodeObject: self.yearFounded forKey: @"yearFounded"];
63  
-    [aCoder encodeObject: self.assistants forKey: @"assistants"];
64  
-    [aCoder encodeObject: self.departments forKey: @"departments"];
65  
-    [aCoder encodeObject: self.employees forKey: @"employees"];
66  
-}
67  
-
68 38
 #pragma mark Scalar values
  39
+
69 40
 - (int)yearFoundedValue
70 41
 {
71 42
 	return [self.yearFounded intValue];
@@ -77,6 +48,7 @@ - (void)setYearFoundedValue:(int)value_
77 48
 }
78 49
 
79 50
 
  51
+
80 52
 #pragma mark Dictionary representation
81 53
 
82 54
 - (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary
@@ -85,19 +57,21 @@ - (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary
85 57
 	{
86 58
 		self.name = [dictionary objectForKey:@"ModelCompany.name"];
87 59
 		self.yearFounded = [dictionary objectForKey:@"ModelCompany.yearFounded"];
  60
+		
  61
+		
88 62
 		for(id objectRepresentationForDict in [dictionary objectForKey:@"ModelCompany.assistants"])
89 63
 		{
90  
-            ModelAssistant *assistantsObj = [[[ModelAssistant alloc] initWithDictionaryRepresentation:objectRepresentationForDict] autorelease];
  64
+			ModelAssistant *assistantsObj = [[[ModelAssistant alloc] initWithDictionaryRepresentation:objectRepresentationForDict] autorelease];
91 65
 			[self addAssistantsObject:assistantsObj];
92 66
 		}
93 67
 		for(id objectRepresentationForDict in [dictionary objectForKey:@"ModelCompany.departments"])
94 68
 		{
95  
-            ModelDepartment *departmentsObj = [[[ModelDepartment alloc] initWithDictionaryRepresentation:objectRepresentationForDict] autorelease];
  69
+			ModelDepartment *departmentsObj = [[[ModelDepartment alloc] initWithDictionaryRepresentation:objectRepresentationForDict] autorelease];
96 70
 			[self addDepartmentsObject:departmentsObj];
97 71
 		}
98 72
 		for(id objectRepresentationForDict in [dictionary objectForKey:@"ModelCompany.employees"])
99 73
 		{
100  
-            ModelEmployee *employeesObj = [[[ModelEmployee alloc] initWithDictionaryRepresentation:objectRepresentationForDict] autorelease];
  74
+			ModelEmployee *employeesObj = [[[ModelEmployee alloc] initWithDictionaryRepresentation:objectRepresentationForDict] autorelease];
101 75
 			[self addEmployeesObject:employeesObj];
102 76
 		}
103 77
 	}
@@ -110,33 +84,44 @@ - (NSDictionary *)dictionaryRepresentation
110 84
 	NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[super dictionaryRepresentation]];
111 85
 	[dict setObjectIfNotNil:self.name forKey:@"ModelCompany.name"];
112 86
 	[dict setObjectIfNotNil:self.yearFounded forKey:@"ModelCompany.yearFounded"];
  87
+	
113 88
 	if([self.assistants count] > 0)
114 89
 	{
115  
-		NSMutableSet *assistantsRepresentationsForDictionary = [NSMutableSet setWithCapacity:[self.assistants count]];
  90
+		
  91
+		NSMutableArray *assistantsRepresentationsForDictionary = [NSMutableArray arrayWithCapacity:[self.assistants count]];
116 92
 		for(ModelAssistant *obj in self.assistants)
117 93
 		{
118 94
 			[assistantsRepresentationsForDictionary addObject:[obj dictionaryRepresentation]];
119 95
 		}
120 96
 		[dict setObjectIfNotNil:assistantsRepresentationsForDictionary forKey:@"ModelCompany.assistants"];
  97
+		
121 98
 	}
  99
+	
122 100
 	if([self.departments count] > 0)
123 101
 	{
124  
-		NSMutableSet *departmentsRepresentationsForDictionary = [NSMutableSet setWithCapacity:[self.departments count]];
  102
+		
  103
+		NSMutableArray *departmentsRepresentationsForDictionary = [NSMutableArray arrayWithCapacity:[self.departments count]];
125 104
 		for(ModelDepartment *obj in self.departments)
126 105
 		{
127 106
 			[departmentsRepresentationsForDictionary addObject:[obj dictionaryRepresentation]];
128 107
 		}
129 108
 		[dict setObjectIfNotNil:departmentsRepresentationsForDictionary forKey:@"ModelCompany.departments"];
  109
+		
130 110
 	}
  111
+	
131 112
 	if([self.employees count] > 0)
132 113
 	{
133  
-		NSMutableSet *employeesRepresentationsForDictionary = [NSMutableSet setWithCapacity:[self.employees count]];
  114
+		
  115
+		NSMutableArray *employeesRepresentationsForDictionary = [NSMutableArray arrayWithCapacity:[self.employees count]];
134 116
 		for(ModelEmployee *obj in self.employees)
135 117
 		{
136 118
 			[employeesRepresentationsForDictionary addObject:[obj dictionaryRepresentation]];
137 119
 		}
138 120
 		[dict setObjectIfNotNil:employeesRepresentationsForDictionary forKey:@"ModelCompany.employees"];
  121
+		
139 122
 	}
  123
+	
  124
+	
140 125
 	return dict;
141 126
 }
142 127
 
@@ -145,140 +130,111 @@ - (void)awakeFromDictionaryRepresentationInit
145 130
 	if(self.sourceDictionaryRepresentation == nil)
146 131
 		return; // awakeFromDictionaryRepresentationInit has been already executed on this object.
147 132
 	
  133
+	
  134
+
  135
+
  136
+	
148 137
 	for(ModelDepartment *departmentsObj in self.departments)
149 138
 	{
150 139
 		[departmentsObj awakeFromDictionaryRepresentationInit];
151 140
 	}
  141
+	
152 142
 	for(ModelAssistant *assistantsObj in self.assistants)
153 143
 	{
154 144
 		[assistantsObj awakeFromDictionaryRepresentationInit];
155 145
 	}
  146
+	
156 147
 	for(ModelEmployee *employeesObj in self.employees)
157 148
 	{
158 149
 		[employeesObj awakeFromDictionaryRepresentationInit];
159 150
 	}
160 151
 	
  152
+	
161 153
 	[super awakeFromDictionaryRepresentationInit];
162 154
 }
163 155
 
164 156
 #pragma mark Direct access
165 157
 
166  
-- (void)addAssistantsObject:(ModelAssistant*)value_ settingInverse: (BOOL) setInverse
  158
+
  159
+- (void)addAssistantsObject:(ModelAssistant*)value_
167 160
 {
168  
-    if(self.assistants == nil)
  161
+	if(self.assistants == nil)
169 162
 	{
170  
-		self.assistants = [NSMutableSet set];
  163
+		self.assistants = [NSMutableArray array];
171 164
 	}
172 165
 		
173  
-	[(NSMutableSet *)self.assistants addObject:value_];
174  
-	if (setInverse == YES) {
175  
-	    [value_ setCompany: (ModelCompany*)self settingInverse: NO];
176  
-	}
177  
-}
178  
-
179  
-- (void)addAssistantsObject:(ModelAssistant*)value_
180  
-{
181  
-    [self addAssistantsObject:(ModelAssistant*)value_ settingInverse: YES];
  166
+	[(NSMutableArray *)self.assistants addObject:value_];
  167
+	value_.company = (ModelCompany*)self;
182 168
 }
183 169
 
184 170
 - (void)removeAssistantsObjects
185 171
 {
186  
-	self.assistants = [NSMutableSet set];
187  
-}
188  
-
189  
-- (void)removeAssistantsObject:(ModelAssistant*)value_ settingInverse: (BOOL) setInverse
190  
-{
191  
-    if (setInverse == YES) {
192  
-        [value_ setCompany: nil settingInverse: NO];
193  
-    }
194  
-    [(NSMutableSet *)self.assistants removeObject:value_];
  172
+	self.assistants = [NSMutableArray array];
195 173
 }
196 174
 
197 175
 - (void)removeAssistantsObject:(ModelAssistant*)value_
198 176
 {
199  
-    [self removeAssistantsObject:(ModelAssistant*)value_ settingInverse: YES];
  177
+	value_.company = nil;
  178
+	[(NSMutableArray *)self.assistants removeObject:value_];
200 179
 }
201 180
 
202  
-- (void)addDepartmentsObject:(ModelDepartment*)value_ settingInverse: (BOOL) setInverse
  181
+
  182
+- (void)addDepartmentsObject:(ModelDepartment*)value_
203 183
 {
204  
-    if(self.departments == nil)
  184
+	if(self.departments == nil)
205 185
 	{
206  
-		self.departments = [NSMutableSet set];
  186
+		self.departments = [NSMutableArray array];
207 187
 	}
208 188
 		
209  
-	[(NSMutableSet *)self.departments addObject:value_];
210  
-	if (setInverse == YES) {
211  
-	    [value_ setCompany: (ModelCompany*)self settingInverse: NO];
212  
-	}
213  
-}
214  
-
215  
-- (void)addDepartmentsObject:(ModelDepartment*)value_
216  
-{
217  
-    [self addDepartmentsObject:(ModelDepartment*)value_ settingInverse: YES];
  189
+	[(NSMutableArray *)self.departments addObject:value_];
  190
+	value_.company = (ModelCompany*)self;
218 191
 }
219 192
 
220 193
 - (void)removeDepartmentsObjects
221 194
 {
222  
-	self.departments = [NSMutableSet set];
223  
-}
224  
-
225  
-- (void)removeDepartmentsObject:(ModelDepartment*)value_ settingInverse: (BOOL) setInverse
226  
-{
227  
-    if (setInverse == YES) {
228  
-        [value_ setCompany: nil settingInverse: NO];
229  
-    }
230  
-    [(NSMutableSet *)self.departments removeObject:value_];
  195
+	self.departments = [NSMutableArray array];
231 196
 }
232 197
 
233 198
 - (void)removeDepartmentsObject:(ModelDepartment*)value_
234 199
 {
235  
-    [self removeDepartmentsObject:(ModelDepartment*)value_ settingInverse: YES];
  200
+	value_.company = nil;
  201
+	[(NSMutableArray *)self.departments removeObject:value_];
236 202
 }
237 203
 
238  
-- (void)addEmployeesObject:(ModelEmployee*)value_ settingInverse: (BOOL) setInverse
  204
+
  205
+- (void)addEmployeesObject:(ModelEmployee*)value_
239 206
 {
240  
-    if(self.employees == nil)
  207
+	if(self.employees == nil)
241 208
 	{
242  
-		self.employees = [NSMutableSet set];
  209
+		self.employees = [NSMutableArray array];
243 210
 	}
244 211
 		
245  
-	[(NSMutableSet *)self.employees addObject:value_];
246  
-	if (setInverse == YES) {
247  
-	    [value_ setCompany: (ModelCompany*)self settingInverse: NO];
248  
-	}
249  
-}
250  
-
251  
-- (void)addEmployeesObject:(ModelEmployee*)value_
252  
-{
253  
-    [self addEmployeesObject:(ModelEmployee*)value_ settingInverse: YES];
  212
+	[(NSMutableArray *)self.employees addObject:value_];
  213
+	value_.company = (ModelCompany*)self;
254 214
 }
255 215
 
256 216
 - (void)removeEmployeesObjects
257 217
 {
258  
-	self.employees = [NSMutableSet set];
259  
-}
260  
-
261  
-- (void)removeEmployeesObject:(ModelEmployee*)value_ settingInverse: (BOOL) setInverse
262  
-{
263  
-    if (setInverse == YES) {
264  
-        [value_ setCompany: nil settingInverse: NO];
265  
-    }
266  
-    [(NSMutableSet *)self.employees removeObject:value_];
  218
+	self.employees = [NSMutableArray array];
267 219
 }
268 220
 
269 221
 - (void)removeEmployeesObject:(ModelEmployee*)value_
270 222
 {
271  
-    [self removeEmployeesObject:(ModelEmployee*)value_ settingInverse: YES];
  223
+	value_.company = nil;
  224
+	[(NSMutableArray *)self.employees removeObject:value_];
272 225
 }
273 226
 
274 227
 
  228
+
275 229
 - (void)dealloc
276 230
 {
277 231
 	self.name = nil;
278 232
 	self.yearFounded = nil;
  233
+	
279 234
 	self.assistants = nil;
280 235
 	self.departments = nil;
281 236
 	self.employees = nil;
  237
+	
282 238
 	[super dealloc];
283 239
 }
284 240
 
@@ -286,6 +242,7 @@ - (void)dealloc
286 242
 
287 243
 @synthesize name;
288 244
 @synthesize yearFounded;
  245
+
289 246
 @synthesize assistants;
290 247
 @synthesize departments;
291 248
 @synthesize employees;
18  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartment.h
@@ -10,7 +10,6 @@
10 10
 
11 11
 #import <Foundation/Foundation.h>
12 12
 #import "ModelObject.h"
13  
-#import "ModelObject.h"
14 13
 
15 14
 @class ModelDepartmentAssistant;
16 15
 @class ModelCompany;
@@ -22,42 +21,35 @@
22 21
 @end
23 22
 
24 23
 
25  
-@interface _ModelDepartment : ModelObject <NSCoding>
  24
+@interface _ModelDepartment : ModelObject
26 25
 {
27 26
 	NSString *name;
28 27
 	
29 28
 	
30  
-	NSSet *assistants;
  29
+	NSArray *assistants;
31 30
 	
32 31
 	ModelCompany *company;
33 32
 	
34  
-	NSSet *employees;
  33
+	NSArray *employees;
35 34
 	
36 35
 }
37 36
 
38 37
 @property (nonatomic, retain, readwrite) NSString *name;
39 38
 
40  
-@property (nonatomic, retain, readonly) NSSet *assistants;
  39
+@property (nonatomic, retain, readonly) NSArray *assistants;
41 40
 @property (nonatomic, assign, readwrite) ModelCompany *company;
42 41
 
43  
-@property (nonatomic, retain, readonly) NSSet *employees;
  42
+@property (nonatomic, retain, readonly) NSArray *employees;
44 43
 
45 44
 
46  
-- (void)addAssistantsObject:(ModelDepartmentAssistant*)value_ settingInverse: (BOOL) setInverse;
47 45
 - (void)addAssistantsObject:(ModelDepartmentAssistant*)value_;
48 46
 - (void)removeAssistantsObjects;
49  
-- (void)removeAssistantsObject:(ModelDepartmentAssistant*)value_ settingInverse: (BOOL) setInverse;
50 47
 - (void)removeAssistantsObject:(ModelDepartmentAssistant*)value_;
51 48
 
52 49
 
53  
-- (void)addEmployeesObject:(ModelDepartmentEmployee*)value_ settingInverse: (BOOL) setInverse;
54 50
 - (void)addEmployeesObject:(ModelDepartmentEmployee*)value_;
55 51
 - (void)removeEmployeesObjects;
56  
-- (void)removeEmployeesObject:(ModelDepartmentEmployee*)value_ settingInverse: (BOOL) setInverse;
57 52
 - (void)removeEmployeesObject:(ModelDepartmentEmployee*)value_;
58 53
 
59 54
 
60  
-- (void) setCompany: (ModelCompany*) company_ settingInverse: (BOOL) setInverse;
61  
-
62  
-
63 55
 @end
163  contributed templates/Nikita Zhuk/ponso/sample project/PonsoTest/Sources/DataModel/_ModelDepartment.m
@@ -7,64 +7,37 @@
7 7
 // Make changes to ModelDepartment.h instead.
8 8
 //
9 9
 
10  
-
11 10
 #import "_ModelDepartment.h"
12 11
 
13 12
 #import "ModelDepartmentAssistant.h"
14 13
 #import "ModelCompany.h"
15 14
 #import "ModelDepartmentEmployee.h"
16 15
 
  16
+
17 17
 @interface _ModelDepartment()
18  
-@property (nonatomic, retain, readwrite) NSSet *assistants;
19  
-@property (nonatomic, retain, readwrite) NSSet *employees;
  18
+@property (nonatomic, retain, readwrite) NSArray *assistants;
  19
+@property (nonatomic, retain, readwrite) NSArray *employees;
  20
+
20 21
 @end
21 22
 
22 23
 /** \ingroup DataModel */
23 24
 
24  
-NS_INLINE NSMutableSet* NonretainingNSMutableSetMake()
25  
-{
26  
-    CFSetCallBacks callbacks = {0, NULL, NULL, CFCopyDescription, CFEqual, CFHash};
27  
-    return [(NSMutableSet*) CFSetCreateMutable(0, 0, &callbacks) autorelease];
28  
-}
29  
-
30 25
 @implementation _ModelDepartment
  26
+
31 27
 - (id)init
32 28
 {
33 29
 	if((self = [super init]))
34 30
 	{
  31
+		
35 32
 	}
36 33
 	
37 34
 	return self;
38 35
 }
39 36
 
40  
-- (id) initWithCoder: (NSCoder*) aDecoder
41  
-{
42  
-    if ([[super class] instancesRespondToSelector: @selector(initWithCoder:)]) {
43  
-        self = [super initWithCoder: aDecoder];
44  
-    } else {
45  
-        self = [super init];
46  
-    }
47  
-    if (self) {
48  
-        self.name = [aDecoder decodeObjectForKey: @"name"];
49  
-        self.assistants = [aDecoder decodeObjectForKey: @"assistants"];
50  
-        self.company = [aDecoder decodeObjectForKey: @"company"];
51  
-        self.employees = [aDecoder decodeObjectForKey: @"employees"];
52  
-    }
53  
-    return self;
54  
-}
55  
-
56  
-- (void) encodeWithCoder: (NSCoder*) aCoder
57  
-{
58  
-    [super encodeWithCoder: aCoder];
59  
-    [aCoder encodeObject: self.name forKey: @"name"];
60  
-    [aCoder encodeObject: self.assistants forKey: @"assistants"];
61  
-    [aCoder encodeObject: self.company forKey: @"company"];
62  
-    [aCoder encodeObject: self.employees forKey: @"employees"];
63  
-}
64  
-
65 37
 #pragma mark Scalar values
66 38
 
67 39
 
  40
+
68 41
 #pragma mark Dictionary representation
69 42
 
70 43
 - (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary
@@ -72,14 +45,16 @@ - (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary
72 45
 	if((self = [super initWithDictionaryRepresentation:dictionary]))
73 46
 	{
74 47
 		self.name = [dictionary objectForKey:@"ModelDepartment.name"];
  48
+		
  49
+		
75 50
 		for(id objectRepresentationForDict in [dictionary objectForKey:@"ModelDepartment.assistants"])
76 51
 		{
77  
-            ModelDepartmentAssistant *assistantsObj = [[[ModelDepartmentAssistant alloc] initWithDictionaryRepresentation:objectRepresentationForDict] autorelease];
  52
+			ModelDepartmentAssistant *assistantsObj = [[[ModelDepartmentAssistant alloc] initWithDictionaryRepresentation:objectRepresentationForDict] autorelease];
78 53
 			[self addAssistantsObject:assistantsObj];
79 54
 		}
80 55
 		for(id objectRepresentationForDict in [dictionary objectForKey:@"ModelDepartment.employees"])
81 56
 		{
82  
-            ModelDepartmentEmployee *employeesObj = [[[ModelDepartmentEmployee alloc] initWithDictionaryRepresentation:objectRepresentationForDict] autorelease];
  57
+			ModelDepartmentEmployee *employeesObj = [[[ModelDepartmentEmployee alloc] initWithDictionaryRepresentation:objectRepresentationForDict] autorelease];
83 58
 			[self addEmployeesObject:employeesObj];
84 59
 		}
85 60
 	}
@@ -91,24 +66,36 @@ - (NSDictionary *)dictionaryRepresentation
91 66
 {
92 67
 	NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:[super dictionaryRepresentation]];
93 68
 	[dict setObjectIfNotNil:self.name forKey:@"ModelDepartment.name"];
  69
+	
94 70
 	if([self.assistants count] > 0)
95 71
 	{
96  
-		NSMutableSet *assistantsRepresentationsForDictionary = [NSMutableSet setWithCapacity:[self.assistants count]];
  72
+		
  73
+		NSMutableArray *assistantsRepresentationsForDictionary = [NSMutableArray arrayWithCapacity:[self.assistants count]];
97 74
 		for(ModelDepartmentAssistant *obj in self.assistants)
98 75
 		{
99 76
 			[assistantsRepresentationsForDictionary addObject:[obj dictionaryRepresentation]];
100 77
 		}
101 78
 		[dict setObjectIfNotNil:assistantsRepresentationsForDictionary forKey:@"ModelDepartment.assistants"];
  79
+		
102 80
 	}
  81
+	
  82
+	
  83
+	
  84
+	
  85
+	
103 86
 	if([self.employees count] > 0)
104 87
 	{
105  
-		NSMutableSet *employeesRepresentationsForDictionary = [NSMutableSet setWithCapacity:[self.employees count]];
  88
+		
  89
+		NSMutableArray *employeesRepresentationsForDictionary = [NSMutableArray arrayWithCapacity:[self.employees count]];
106 90
 		for(ModelDepartmentEmployee *obj in self.employees)
107 91
 		{
108 92
 			[employeesRepresentationsForDictionary addObject:[obj dictionaryRepresentation]];
109 93
 		}
110 94
 		[dict setObjectIfNotNil:employeesRepresentationsForDictionary forKey:@"ModelDepartment.employees"];
  95
+		
111 96
 	}
  97
+	
  98
+	
112 99
 	return dict;
113 100
 }
114 101
 
@@ -117,125 +104,91 @@ - (void)awakeFromDictionaryRepresentationInit
117 104
 	if(self.sourceDictionaryRepresentation == nil)
118 105
 		return; // awakeFromDictionaryRepresentationInit has been already executed on this object.
119 106
 	
120  
-	for(ModelDepartmentAssistant *assistantsObj in self.assistants)
121  
-	{
122  
-		[assistantsObj awakeFromDictionaryRepresentationInit];
123  
-	}