DEVELOPING M2M APPLICATIONS
WITH MANGO
Béla Juhász
Bachelor’s Thesis
December 2009
Degree Programme in Information Technology
School of Technology
CONTENTS
1  OBJECTIVE OF THE PROJECT (5)
2  MANGO M2M SERVER APPLICATION (6)
2.1  Main concepts in Mango (7)
2.2  Installation (11)
2.3  Compilation (11)
2.4  Software components used (13)
3  SPRING WEB MVC (14)
3.1  The MVC architecture (14)
3.2  Request processing in Spring MVC (15)
3.3  Handler mappings (18)
3.4  Controllers (18)
3.5  Views (22)
3.6  Ajax with DWR (23)
3.7  Analysis of a request (24)
4  DATABASE STRUCTURE IN MANGO (30)
4.1  Tables visualized (30)
4.2  Data access layer (31)
5  AN EXAMPLE MODIFICATION (35)
5.1  The task (35)
5.2  Implementation (36)
6  CONCLUSION (39)
REFERENCES (40)
FIGURES
FIGURE 1. Graphical representations of sensors
FIGURE 2. An example DataSource with DataPoints
FIGURE 3. Details and actual values of a data point
FIGURE 4. Watch list
FIGURE 5. Graphical view
FIGURE 6. The mobile version of the watch list shown in Figure 4
FIGURE 7. The request processing workflow in Spring Web MVC
FIGURE 8. The most important tables in Mango
FIGURE 9. The details of an HTTP Retriever DataSource
FIGURE 10. An HTTP Image DataSource and its DataPoint
FIGURE 11. The clickable rendered image
TERMINOLOGY
Machine to Machine
Machine to Machine (often abbreviated as M2M) refers to data communications between machines. The term also means the complexity of sensors which produce data, the communications channel which connects the sensors to a server computer
and a software running on the server, having the task to analyse and report the collected data. Sometimes the same software is capable of intervening into the process. (Machine to Machine 2009.)
Open source software
Open source software is a computer software where the source code is provided under a software license that meets the Open Source Definition or it is in the public domain. Open source software therefore can be edited, modified and then redistributed freely, given certain conditions are met (e.g. n
ot placing the software under a more restrictive license, providing the license with the software, etc.) (Open Source Initiative 2009.)
Mango
The open-source Mango software is one – although a crucial – element of a whole
M2M system. Its role is to gather and process data, present this raw data in a way which is comprehensible to a human operator who can, in turn, send commands and thus control the process: Mango is an “open source alternative for Machine-to-Machine (M2M) software [...]. Mango is browser-based, Ajax-enabled M2M software that enables users to access and control electronic sensors, devices, and machines over multiple protocols simultaneously.” (Mango, open source M2M 2009.)
MVC
MVC is the acronym for the Model–View–Controller (MVC) architectural pattern used in software engineering. The purpose of this pattern is to simplify the implementation of applications that need to act on user requests and manipulate and display data. The model is the data to be presented to the user. The view part is in charge of rendering the model in a suitable manner. And lastly, the controller is
responsible for processing and acting on user requests. It loads and prepares the model, chooses the appropriate view and finally passes the model to the chosen view for rendering. (Machacek, Vukotic, Chakraborty & Ditt 2008, 611.)programme用法
Spring's Web MVC framework
Spring is an open source framework, created by Rod Johnson. It was created to address the complexity of enterprise application development. With a more technical description one could describe it as a lightweight dependency injection and aspect-oriented container and framework. For a more in-depth analyses of Spring, refer to Walls 2008. The Spring framework is made up of several well-defined modules built on top of the core container. Such modules are for example the ORM integration module, JMX module, JDBC abstraction and the DAO module. The Spring Web MVC framework is just one of these modules, implementing the MVC architectural pattern. (Ladd, Donald 2006, 7.)
Direct Web Remoting
“DWR, which is short for Direct Web Remoting, is a Java-based Ajax framework that lets you access virtually any server-side Java object through JavaScript. DWR abstracts XMLHttpRequest away so tha
t invoking methods on a server-side Java object is as simple as invoking methods on a client-side JavaScript object.” (Walls 2008, 650.) DWR dynamically converts the server-side Java objects into JavaScript ones that implement the same interface as the original Java objects. The JavaScript libraries are also responsible for sending XMLHttpRequest s from the browser to the server and dynamically updating the web page with the data sent back.
Dojo JavaScript toolkit
Dojo is an open source JavaScript framework that simplifies Ajax programming. It is a collection of JavaScript components to assist building JavaScript applications.

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。