Rightpoint / RZImport

Automatic importing of data from NSDictionary to Cocoa objects
Other
18 stars 6 forks source link

pre and post callbacks on import #32

Open bsmith11 opened 8 years ago

bsmith11 commented 8 years ago

@arrouse @ZevEisenberg @KingOfBrian @mgorbach @jvisenti

Should satisfy #17

KingOfBrian commented 8 years ago

The semantics of conditionally creating the object on an instance level method are a bit strange to me.

Also, I'm not sure that it provides any functionality that you couldn't obtain by implementing rzi_existingObjectForDict: and overriding rzi_importValuesFromDict:withMappings:. To me the implementation via over-rides would make more sense. I'd also prefer not to expand the API surface area if we don't have to.

That said, what and how to over-ride methods in RZImport aren't always as clear. I'm just not sure what problem we're solving here.

Edit: Early submit.

bsmith11 commented 8 years ago

Agreed about the instance method determining whether to return an instance. I think changing it from shouldImport to willImport could be a good idea. The use cases for not importing a single object are probably slim to none. I do like having the pre and post callbacks though, as it provides a clear place to handle weird situations that usually come up when dealing with less than ideal APIs