I have an interesting decision I would like some help with.
I am forming a request to my DB from a view where I select several (18) values (not all are required to be selected), these values will then be sent from my view to my request variable where I put the parameters into an XML request.
So I am wondering do I create a method with 18 parameters that are not necessarily all required!?? or create a single parameter out of all of the possible variables, send the data over to the destination then decode there?
example of how this is going to work.
- UIViewController, select all values needed.
- Hit send button which has a method attached to it, then sends all the values off to my requestController
- request controller then sends XML to DB as a request.
so my question is whats the best way to send my values from one method to another.
Any help would be greatly appreciated.
Especially if it’s going to become xml eventually, an NSDictionary is probably your best bet. Fill it with keys – which can eventually become your xml tags – and the values collected by the view. It’s one param to pass, and a missing key/value is a zero overhead way to send an optional param that isn’t present.