12.01.2015 Views

Download - Academy Publisher

Download - Academy Publisher

Download - Academy Publisher

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ISBN 978-952-5726-09-1 (Print)<br />

Proceedings of the Second International Symposium on Networking and Network Security (ISNNS ’10)<br />

Jinggangshan, P. R. China, 2-4, April. 2010, pp. 157-160<br />

Developing Mobile Input Method System Using<br />

An Improved Design Pattern Approach<br />

Fei Zhu 1,2 , Hongjun Diao 1,2* , and Wei Huang 1,2*<br />

1 School of Computer Science and Technology, Soochow University<br />

2 Provincial Key Laboratory for Computer Information Processing Technology, Soochow University<br />

Email: zhufei@suda.edu.cn<br />

Suzhou, Jiangsu, China, 215006<br />

Email: { hjdiao, huangwei}@suda.edu.cn<br />

Abstract—Popularity of operation system on mobile phone<br />

makes it possible to develop a third party input method<br />

system for it. However variety in mobile models and systems<br />

makes it difficult to develop a general input method for<br />

different models. As design pattern usually add reusability<br />

and flexibility to software development process, we propose<br />

an approach to develop input method for mobile using state<br />

design pattern. With the idea of event-based finite state<br />

machine, we design a novel event-condition-state pattern<br />

framework. We use it develop a thirty party input method<br />

system which contains a Windows Mobile system version<br />

and a Symbian system version. We utilized common part of<br />

the systems with sub pattern model and then rewrote<br />

related interfaces to different systems, instead of carrying<br />

out two developing activities. With the state design pattern,<br />

the whole development process turns to simpler and clearer,<br />

saving us much work in design and developing. It also<br />

provides convenience for future maintenance and updating<br />

as well.<br />

Index Terms—software developing, design pattern, mobile<br />

developing, mobile input method<br />

I. INTRODUCTION<br />

In software engineering, a design pattern is a general<br />

reusable solution to a commonly occurring problem in<br />

software design. It is widely used in software<br />

development. State pattern, a behavioral software design<br />

pattern, is often used to represent the states of an object<br />

and is applied to develop software that has multiple states.<br />

For example, documents in office automation system<br />

with workflow typically have multiple states, including<br />

editing, waiting for auditing, being audited, replying and<br />

forwarding. Microsoft Pinyin input method system can be<br />

in one of the states, including initial state before input,<br />

input state, and selecting state after input. State pattern<br />

can be applied in these two kinds of software.<br />

However, design pattern is a description or framework<br />

for how to solve a problem that can be used in many<br />

different situations but not a determined design that can<br />

be transformed directly into code. The famous state<br />

design pattern proposed by Erich Gamma, Richard Helm,<br />

Ralph Johnson and John Vlissides is not a determined<br />

design that can be transformed directly into code either.<br />

One of the common methods to implement the state<br />

design pattern is to use IF-ELSE-IF statement provided<br />

by most programming languages. However too many<br />

branches of IF-ELSE-IF will make the program structure<br />

and logic unclear, making it harder for future potential<br />

modification and updating. Meanwhile, using eventresponse<br />

mechanism provided by modern programming<br />

technology, it is of benefit to refine the similar functional<br />

structures and change IF-ELSE-IF statement to eventresponse<br />

ones so as to promote readability and reusability<br />

as well as relieving design efforts.<br />

In this paper, we propose a novel event-condition-state<br />

pattern framework, which is an event-based finite sate<br />

machine, for software development. With the pattern<br />

framework, we developed a third party input method<br />

system which has a Microsoft Mobile version for<br />

Microsoft Mobile system and a Symbian version for<br />

Symbian system. We found it easy to fulfill development<br />

with the help of the framework. We did not carry out two<br />

developing activities for input method system. Instead,<br />

we utilized common part of the systems with sub pattern<br />

model and then rewrote related interfaces to different<br />

systems. By this, we spared lots of redundant efforts in<br />

developing, and gained convenience in later synchronous<br />

updating and maintenance.<br />

II. IMPROVING STATE DESIGN PATTERN<br />

Erich Gamma, Richard Helm, Ralph Johnson and John<br />

Vlissides, referred to as the GoF, described recurring<br />

solutions to common problems in software design. As we<br />

can see in figure 1, although GoF described a reasonable<br />

state pattern, their framework only gave relations among<br />

context objects and state objects in short, which is not<br />

enough for implementation. There normally are many<br />

response events, causing the structure of processing<br />

method very much complex, which will lead to<br />

inefficiency in software development.<br />

Figure 1. State pattern class diagram which merely shows relations<br />

among context object and state object without interpreting details of<br />

implementation<br />

© 2010 ACADEMY PUBLISHER<br />

AP-PROC-CS-10CN006<br />

157

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!