开发者

Web service controller design issue

开发者 https://www.devze.com 2023-01-18 06:14 出处:网络
I have various UIViewControllers that need data from we开发者_Python百科b services.Is it best to create separate controller classes which the UIViewController\'s in turn call or keep the code inside t

I have various UIViewControllers that need data from we开发者_Python百科b services. Is it best to create separate controller classes which the UIViewController's in turn call or keep the code inside the UIViewController?

The reason I ask is because with delegation you kind of have to leave some of the connection code in the calling class in this case the UIViewController.


I would create a new class which manages all interactions with your web services. This makes maintenance much more manageable and has better separation of responsibilities.

0

精彩评论

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