IPhone and iPad Design - Good design architecture for maximum reuse

I have three questions related to the development of the iPhone and iPad. I am writing an iPhone application that should also be available for iPad in the future. Using the MVC pattern, I know that I will keep my models, however, it is not clear to me whether controllers and / or views should be dropped. So my questions are:

1) For those developing the same application for both platforms, what are the best practices? Which parts are usually reused and which parts are usually discarded in order to develop both applications with minimal effort and proper design?

2) In addition, I also need to have state / global information in the application. How do you process (design-wise) โ€œstateโ€ of information in an iPhone / iPad application? I currently have user information (username and password) that I need to use throughout the application to make multiple server requests (encoded in the http header). For this, I have a user model stored in the AppDelegate class. Is this normal in terms of design, or should it be done differently?

3) Finally, my models are separated by abstract classes (or classes that handle common material) and subclasses that specialize in different tasks. The idea is to write as little code as possible to avoid repeating the code (for example: sending requests is common, and disassembly responses depend on the task). Performance wise, is it worth it to separate the code from several classes and have model inheritance?

Thanks in advance!

+4
source share
1 answer

1) Well-designed models, views, and controllers should be mostly reused for iOS devices. The degree of difference in user interface design between platforms is largely dictated by the ability to reuse view controllers. For example, when working on an iPad, view controllers may be presented in a split view or popover view, rather than in full-screen mode, and action sheets presented using the panel buttons will most likely not have a cancel button.

2) Do not save the state in the application deletion. Instead, save it in the model class. The username and passwords in particular should be stored in the keychain.

3) Class hierarchies that are too complex can reduce flexibility and make it difficult to understand how things work, but don't worry about performance regarding the complexity of the class hierarchy. Instead, measure performance and optimize the time when you get the most out of it with the least effort. This is unlikely to be an implementation of the implementation of the superclass method.

+1
source

All Articles