Objective-C 2.0 gave us @properties.
- They allow for introspection.
- They allow for declarative programming.
- The @synthesize and @dynamic mechanisms relieve use from having to write repetitive, stock accessors.
- Finally, there is the ‘dot’ property syntax, which some love, and some hate.
That isn't what I'm hear to ask. Like any new feature, there is an initially tendency to want to use @property everywhere. So where is property use appropriate?
Clearly in model objects, attributes and relationships are good fodder for properties.
@property(...) NSString *firstName;
@property(...) NSString *lastName;
@property(...) Person *parent;
Even synthesized/computed attributes seem like a good use case for properties.
@property(...) NSString *fullName;
Where else have you used properties? Where have you used them, then later decided it was an inappropriate use of the feature?
Do you use properties for your private object attributes?
Can you think of any examples of things which aren't properties in Cocoa, which at first look, seem like they might want to be properties, but after closer inspection, are actual an example of abuse or property-itis?