CSC/ECE 517 Fall 2009/wiki3 21 MobileDesignPattern

From Expertiza_Wiki
Revision as of 04:12, 19 November 2009 by Salt (talk | contribs) (Cut out old stuff, linked in images)
Jump to navigation Jump to search

Design Pattern for Mobile Applications

The popularity of mobile applications is rising. Design patterns are useful in almost any coding tasks. While almost any design pattern could be used within mobile applications, certain patterns are well suited for the unique environment of mobile applications. This paper focuses first on the mobile application environment, then on design patterns that work well within this new emerging environment.

The Mobile Application Environment

The mobile application environment is new and presents many unique opportunities and challenges for developers. It seems almost everyone now has a cellphone, blackberry, or other small portable device. These devices are "getting smarter" in that many people are developing new applications for them. Cell phones no longer are just used to call people, they often have features like text messaging, cameras, video games, web browsers and more. There is much opportunity for developers to write new applications for mobile devices.

While opportunity abounds, there are also quite a few challenges. Mobile applications have less resources than are typically found in other development environments. The screen om mobile devices is typically smaller, there is usually not a keyboard and mouse (user inputs are reduced) [5]. CPU resources are generally less than those found in the typical environment [7]. Power usage is also limited because a battery is typically used, so reducing power use by the application is an important goal [7]. Connections are typically expensive and are often prone to loss of signals [6].

Another problem is that there is a high demand for applications to be developed quickly [7]. The mobile environment is changing rapidly [2]. Some of the lower level programming languages were useful because they produced fast applications, but they took too long to develop with. Now, with the increased demand for applications quickly, Object Oriented Programming (OOP) is used more. While this causes a greater usage of resources, this is outweighed by the much quicker development cycle and the re-use of code. In particular, good solutions may be re-used in OOP [7].

In the mobile environment, applications are often written on different operating systems on different mobile systems. There is increased interaction between mobile systems, especially for cell phones. The Service Oriented Architecture design pattern is especially well suited for this situation. This is a fairly new field, and methods are currently being developed to aid developers.

Ways to Adapt Using Design Patterns

Several principles and patterns have been understood and developed in developing for mobile applications. Many of these methods are still undergoing change and experimentation. There are new methods being developed and others left behind. A design pattern can be defined as a repeatable solution to a common problem in software. It is a template for how to solve the problem, not actual code [7].

Ease of navigation is a particularly important principle, because of the reduced number of user inputs (for example, buttons from 0 to 9 instead of a mouse and keyboard). Everything in an application should be no more than three clicks away. If a program is too "deep", requiring many clicks, this will be a problem because it takes longer to navigate on a mobile device. If the application is to "broad" as in too many links on one page, the data may not all fit on the screen. One way to mitigate this problem is to reduce functionality, to keep the application as simple as possible [5].

!!!! Insert EC Factory here

The Model View Controller pattern [1] fits the mobile environment well. Models may be set up so that optimum data structures are used, as was discussed for the EC Factory pattern [7]. Effecient designs may be built into the controllers. Views may be standardized for the application to handle the small screens.

The meeting pattern is especially useful in mobile environments. One device or application serves as the meeting manager. The meeting manager coordinates and tracks the other agents (programs or applications). These agents communicate with the oversight of the meeting manager. Agents may be located on different devices, even on computers with more resources. This is especially well suited for the mobile environment because it is a good way to manage the communications and relatively small applications. A further benefit of the meeting pattern is that mobile applications may be combined (somewhat in the fashion of parallel computing) to do more and provide more resources [6].

The master slave pattern is simmilar to the meeting pattern. Instead of a meeting manager and agents, there is a master that creates, uses, and destroys slave objects. The master assigns the slaves tasks to complete. Like agents in the meeting pattern, slaves may be located on different mobile devices, or even on computers that have more resources. The master / slave pattern is very useful for performing actions in parallel on different mobile devices [6].

Conclusion

In conclusion, certain design patterns are especially useful in the mobile design environment. These patterns help developers to produce applications quickly and applications which make efficient use of the limited resources in the mobile environment. Most design patterns can be of benefit to mobile applications, but certain patterns have features that are especially well suited. The EC factory pattern was designed for the mobile environment to reduce energy use [7]. A few other patterns show much promise with mobile devices, including the meeting pattern, master / slave pattern, and service oriented architectures.

References

1. http://www.javaworld.com/javaworld/jw-10-2005/jw-1003-mvc.html

2. http://patterns.littlespringsdesign.com/index.php/The_mobile_challenge

3. http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki2_17_va - Service Oriented Architecture

4. http://wiki.forum.nokia.com/index.php/Understading_Desing_Patterns - Understanding Design Patterns

5. http://dev.opera.com/articles/view/designing-and-developing-mobile-web-site/

6. Emerson F.A Lima, Patrícia D. L. Machado, Fláavio R. Sampaio, and Jorge C. A. Figueiredo. ACM SIGSOFT Software Engineering Notes. Volume 29, issue 3 ISSN: 0163-5948 http://portal.acm.org/citation.cfm?id=986710.986726 Universidade Federal de Campina Grande, Paraíba, Brazil, May, 2004.

7. Kayun Chantarasathaporn, Chonawat Srisa-an. ACM International Conference Proceeding Series; Vol. 270 Proceedings of the 3rd international conference on Mobile technology, applications & systems SESSION: Mobile applications, article 29. ISBN:1-59593-519-3 http://portal.acm.org/citation.cfm?id=1292331.1292364 Bangkok, Thailand, 2006