TradeItIosTicketSDK2 icon indicating copy to clipboard operation
TradeItIosTicketSDK2 copied to clipboard

Properties need review

Open adamkaplan opened this issue 8 years ago • 2 comments

Most properties are written as @property (nullable) Type *thing. This means that the default atomic keyword is implied. So, every property has a thread synchronization lock included. That’s a lot of unneeded overhead for a UI Framework where everything is expected to be used by a single thread.

Atomic properties are a farce anyway. If you are setting one property on thread A and another property on thread B, it’s almost guaranteed to create bugs as the property values can get out of sync. IMO is vastly preferable to state that the classes are explicitly not thread safe, unless you actually intend for them to be (which is a lot of work to do correctly).

adamkaplan avatar Nov 09 '16 20:11 adamkaplan

Additionally, some classes like TradeItLinkedLogin use the nice initWith... model to set all properties. In this case the class should be immutable, otherwise there is not really any point to maintaining the initializer.

adamkaplan avatar Nov 09 '16 20:11 adamkaplan

I agree and will discuss this with @mitochondrion tomorrow

jsom avatar Nov 09 '16 21:11 jsom