开发者

architecture question for iphone apps posting json data to wcf service

I am creating an iPhone app for doing time entry against projects. My UI has a UITextField for each day of the week for the user to enter hours worked by day. I'm working on the data entry piece and have to decide if I should submit the time entered for a given UITextfield as the user has finished entering time, or should I do a batch submission after user finished entering time for the entire week. The first approach would result in a "chatty" app in that a call to my WCF service would be fired asynchronously after every UITextField modification. The latter approach would r开发者_开发百科equire an additional user action (i.e. clicking a save button) to batch submit all time entered.

I'm leaning to the first approach and have a "chatty" app that sends data back to WCF service after each UITextField modification. Doing this asynchronously should not interfere with user experience. I've been researching ASIHTTPRequest to handle the queue of "chatty" submissions and SBJSON to convert data to JSON payload.

What are your thoughts? Am I approaching this correctly? Will a "chatty" app done asynchronously affect user experience? Thanks for being a sounding board. Is this the right venue to ask architectural questions?


It's more efficient for the phone to make a single request than several. If you look at the overhead of the web request headers compared to the amount of data you're transmitting, it's going to be huge if you make one request per number entered. It's also less energy-efficient for iPhones to initiate several web requests in a row than a single request.

That said, most of that overhead and inefficiency doesn't seem to matter in this case because they're doing this once per week.

User experience will certainly be affected by your choice. If you don't require the user to press a button to commit their changes, you've eliminated one thing they have to do. It's just crucial that you provide proper feedback so that the user can trust that your application has actually saved the data.

You'll want a prominent activity indicator to show when an upload is taking place, and you should enforce a minimum amount of time for the indicator to be on-screen (i.e., if a request takes 100ms, you should still show the indicator for long enough for the user to see it). You probably also want a label that says "Saved" which appears every time the activity indicator disappears. (It should probably say "error" otherwise and provide instructions for how the user can correct the problem.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜