CSC/ECE 517 Fall 2009/wiki3 21 MobileDesignPattern: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
("Clear out" old page while preserving items used for formatting the wiki)
(Copy in our document so far and touchup)
Line 1: Line 1:
== Design Pattern for Mobile Applications ==
== Design Pattern for Mobile Applications ==


[http://en.wikipedia.org/wiki/Service-oriented_architecture ''Service Oriented Architecture'' 3] (or SOA) describes how to
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.


__TOC__
__TOC__
Design Pattern for Mobile Applications
Stylesheets?
Forms?
.......................................
.....................
........
The Mobile Application Environment
- lower resources
    - Low battery power [7]
    - CPU Power [7]
    - Expensive connections [6]
    - Small screens [2]
- Rapidly changing environment [2]
- Quick development cycle [7]
- Difficult communications (e.g. highly prone to lost data) [6]
- Fewer user inputs (often 0-9) so ease of navigation is more important than traditional enviroments [5]
- higher communication with other devices
- Different underlying operating systems and architectures
- At first, code was written in low level languages for mobile devices, but now higher level languages are used to reduce development time. [7]
Design patterns that are a good fit:
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]
- MVC [1]
- Service Oriented Architecture [3]
- Mobile Agent Design Model [6]
- Meeting Pattern [6]
    - agents (applications / etc...)
    - meeting manager (tracks which agents are "met", facilitates meeting (connection))
    - Multiple PDA search example
    - Marketplace example
- Master / slave pattern [6]
    - Master creates remote slave objects to do tasks, slaves report, slaves reused / destroyed
- Energy Concerned (EC) factory [7]
    - The Factory method is used to return an object of the selected type of class.  For example, a Vehicle factory could be coded to return a class object to a car, plane, or boat, depending on what is desired [7].
    - EC Factory makes use of factories to select energy efficient classes: [7]
        - Generics principle [7]
        - Struct vs. class [7]
        - Static vs. dynamic [7]
    - Make less use of memory, more use of registers because registers require less energy [7]
    - Make minimal use of the CPU
    - Object oriented programming (OOP) consumes more power than procedural programming, but the advantages of code reuse with good designs, and quicker development in OOP outweigh the disadvantages
    - Use structs vs. classes, and use static vs. dynamic were possible [7]
of more resource consumption [7]
- Model View Controller Framework???? - changes have minimal impact in this [1] http://www.javaworld.com/javaworld/jw-10-2005/jw-1003-mvc.html
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. http://portal.acm.org/citation.cfm?id=986710.986726
7. http://portal.acm.org/citation.cfm?id=1292331.1292364





Revision as of 05:27, 18 November 2009

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.

Design Pattern for Mobile Applications

Stylesheets? Forms?

....................................... ..................... ........


The Mobile Application Environment

- lower resources

   - Low battery power [7]
   - CPU Power [7]
   - Expensive connections [6]
   - Small screens [2]

- Rapidly changing environment [2] - Quick development cycle [7] - Difficult communications (e.g. highly prone to lost data) [6] - Fewer user inputs (often 0-9) so ease of navigation is more important than traditional enviroments [5] - higher communication with other devices - Different underlying operating systems and architectures - At first, code was written in low level languages for mobile devices, but now higher level languages are used to reduce development time. [7]

Design patterns that are a good fit:


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]

- MVC [1] - Service Oriented Architecture [3] - Mobile Agent Design Model [6] - Meeting Pattern [6]

   - agents (applications / etc...)
   - meeting manager (tracks which agents are "met", facilitates meeting (connection))
   - Multiple PDA search example
   - Marketplace example

- Master / slave pattern [6]

   - Master creates remote slave objects to do tasks, slaves report, slaves reused / destroyed

- Energy Concerned (EC) factory [7]

   - The Factory method is used to return an object of the selected type of class.  For example, a Vehicle factory could be coded to return a class object to a car, plane, or boat, depending on what is desired [7].
   - EC Factory makes use of factories to select energy efficient classes: [7]
       - Generics principle [7]
       - Struct vs. class [7]
       - Static vs. dynamic [7]
   - Make less use of memory, more use of registers because registers require less energy [7]
   - Make minimal use of the CPU
   - Object oriented programming (OOP) consumes more power than procedural programming, but the advantages of code reuse with good designs, and quicker development in OOP outweigh the disadvantages 
   - Use structs vs. classes, and use static vs. dynamic were possible [7]

of more resource consumption [7] - Model View Controller Framework???? - changes have minimal impact in this [1] http://www.javaworld.com/javaworld/jw-10-2005/jw-1003-mvc.html


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. http://portal.acm.org/citation.cfm?id=986710.986726 7. http://portal.acm.org/citation.cfm?id=1292331.1292364


!!!! Note: everything below this point is old and is so we can put in the proper formatting


An overview of the concepts

We created this simplified image to illustrate the basic principles of service oriented architectures.

  • Services may be used by multiple applications.
  • Services do not call on each other.
  • Services communicate via protocols.
  • An example protocol is provided, in which the application passes x to the Sin function, and Sin(x) is returned.
  • Because of the protocol link, services may be written in different programming languages, or even be hosted on different computers with different operating systems, which allows for great flexibility.

language. 7

  • Example: Metaprogramming in Ruby [2]
 class Person
   attr_accessor :name
 end


Conclusion

SOA is an evolution of distributed computing based on web services. It is an attractive solution for companies since it is platform independent allowing different software and hardware to communicate together easily.

Metaprogramming and reflection are programming styles used to take advantage of the features in dynamic programming languages. They provide a great advantage when used in the development of SOAs to allow the services to dynamically change and adapt to the messages being passed between services.

References

1. http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html - Brief explanation of SOA

2. Thomas, Dave (2006). Programming Ruby, The Pragmatic Programmers' Guide.

10. Perrotta, Paolo (2009). Metaprogramming Ruby.