Basically there isn't any right and wrong here, objective-c syntax and coding conventions allow you to have long messages with multiple parameters.
There are a couple of options here:
- Setting these parameters on init (e.g.
initWithId: height: weight:
) - Creating a property for each of them
- Creating an individual function for each of them
- Creating a setProperties function
To decide this you should first ask yourself:
- Does these triplets (Height, Weight, Id) belong together logically?
- Does it make sense to set just one of them?
- Does it makes sense that this object is missing these values?
- Is there a need to make setting these parameters an atomic action?
- Does Immutability of the object matters?
Most of the time I choose to make my object immutable, which means I create a readonly property for them, and set them via init function.