This discussion is a response to the article “Architectural patterns for Mobile Application Development” posted by s1014475.
The author mainly talks about two software design patterns: MVC (model-view-controller) and Layered Abstraction, which can be used for mobile application development in the article. The author also uses some mobile applications he developed as examples, explaining how specifically these patterns can be used in a real project. This post will discuss some points the author raised up in his article, giving some more thoughts on them, and at the end of the post, some more patterns which may also be suitable will be listed.
At the beginning of his article, the author mentioned that mobile applications often require more user interaction compared to its desktop counterpart. The author thought the reason for that is “ (mobile application) usually waiting for an action from the user (such as a button click) ”, which seems not that sufficient. Actually, this point is quite important to the main topic of his article. The comparison between desktop application and mobile application can directly lead to whether a pattern that had been used for desktop application can be used for mobile application as well or not. It could be a good idea to have another session or paragraph talking about the similarity and differences between these two different kinds of applications. Besides, the reason the author gave is also kind of unreasonable, since desktop applications also require lots of responding from users, and more often, desktop applications has more complicated UI constructure. So, this point should be a similarity rather than a difference. And it will make more sense in this way to introduce MVC which has been widely used for desktop application development to mobile application development.
The author then introduced the MVC pattern. He used his own experience on some android application development as examples, which makes it really easy for readers to understand how MVC pattern matches with a project. The author also pointed out that, ”the suitability of MVC pattern depends on the context of the application in question”, which is a good point, just same as there is no silver bullet for software development in general, whether a pattern is suitable or not really depends.
The last point about MVC the author gave in his article is that MVC pattern fits his project well in the high-level overview, but not with closer inspection. The author thought that the definition of a widget in layout file and responding action in java file violates the concept in MVC pattern and then he gives a possible solution for this. However, the author does not make it clear whether it is impossible to fully apply MCV pattern in his project or it is better to use the combined pattern and why is the reason for that.
Then the author talks about layered abstraction. The author made good explanation abut Android system architecture, again, by using his own project as examples. To compare with and make the discussion complete, it’s better to gave some other sample applications developed in other systems, such as IOS and WM6. For example, figure 1 shows the IOS architecture, it’s similar to Android architecture(figure 2). There are two spaces, user space and kernel space. IOS system also has application layer and framework layer, exactly the same as Android. Media and Core Services layer provide the basic services such as graph, audio and video to the user, and these services pretty much has the same functionality as library layers in Android. Finally, core OS, the kernel space include drivers for the devices, it’s same in both systems.
From the comparison of these two systems, we know that most of the mobile systems has a clear architecture and layered abstraction. It is possible for a user to apply this pattern while developing their applications. The author did not mention it in his article, but the main advantages for this pattern is that it makes each component of the system independently, so that it supports large-scale, long-term development and maintenance. Each of the layers can also be reused for other projects. However, the main disadvantage is that when a behavior of a layer changes, it may cause cascades of changing behavior.
Figure 1: IOS Architecture
Figure 2: Android architecture
Finally, except from what the author has introduced, lots of other patterns could also be used for mobile application development, such as: Command, Flyweight, Abstract Factory, Chain of Responsibility, Adapter and so on. Mobile applications has became a more and more important area of software engineering, and applying appropriate patterns while developing the apps will just make things more efficient and effective.