## 5 Implementation Details
### The Key Components of Middleware and Their Relations
However, Agilla provides an energy efficient mechanism for application modification by using mobile agents that can be updated separately, but if an agent in Agilla needs to be replaced with a new one, the new agent should be propagated to all nodes of network and this task consumes a lot of energy. Impala supports energy efficient application modification by allowing the application to be as modular as possible. The key idea is changing a small module of an application needs less energy with comparison to updating the whole application. MiLAN supports energy efficiency by dynamically configuring the underlying network protocol based on the specified QoS by the application. This middleware tunes the network parameters at runtime regarding to application needs and with the goal of minimizing the energy consumption of network. Cougar is not energy efficient because it uses the worthful resources to transfer the large amounts of \begin{table}
\begin{tabular}{|c|p{113.8 pt}|p{113.8 pt}|p{113.8 pt}|p{113.8 pt}|p{113.8 pt}|p{113.8 pt}|} \hline
**Middleware** & **Key features** & **Scalability** & **Power awareness** & **Modifiability** & **Heterogeneity** & **Ease of use** & **General purpose** \\ \hline Impala [9] & Modular programming, Mobile agents, Dynamic code update & Medium & Medium & Medium & Low & Medium & Low \\ \hline TinySOA [22, 23] & Service oriented model, Internet accessible via web services & High & Medium & Medium & Medium & High & High \\ \hline SOMM & Multimedia support, QoS awareness, Service machine, Mobile Agents, Tuple space & High & Medium & High & High & Medium & Medium \\ \hline \end{tabular}
\end{table} 
Table 1: _Cont._unprocessed data from sensor nodes to its database server. Mate supports the energy efficiency by providing grouped aggregation queries using aggregation function. This results in an appreciable bandwidth and energy savings by decreasing the amount of data that should be transferred through the network. Also TinySOA is not fully power aware because it transfers and caches all sensor reading to its database which wastes the resources of network. However SOMM increases the energy efficiency of application modification and node reprogramming by using the concepts of mobile agents and code repositories, the virtual machine used in SOMM introduces some overhead due to its instruction interpretation. #### 6.2.3 Modifiability

Agilla and Mate support modifiability by using virtual machines. Thanks to the virtual machine approach, applications in Mate and also agents in Agilla can be updated without need for reprogramming sensor nodes. Also, it is possible to add new applications to the network after deployment. Cougar and TinyDB are modifiable since adding new capabilities requires modifying the query processor in all sensor nodes. MiLAN is also not modifiable because of its tight coupling with applications. Impala supports modifiability by using mobile agents and modular programming. A module of an application can be updated without need to update the whole application. As mentioned in the previous sub-section, modifiability in SOMM is supported via mobile agents and code repositories. #### 6.2.4 Heterogeneity

Mate and Agilla provide APIs supplemented by virtual machines and hence they support heterogeneity. Impala is designed to run only on Hewlett-Packard/Compaq iPAQ Pocket PC handheld running Linux and it does not support heterogeneity of sensor nodes. Cougar and TinyDB which try to manage large scale networks in a centralized fashion do not support heterogeneity, since heterogeneity of nodes in a large scale sensor network increases the complexities of centralized management of them. MiLAN is an application driven middleware and the tight coupling between this middleware and its applications results in the lack of support for operating systems and hardware heterogeneity. TinySOA is developed on top of TinyOS operating system and utilizes the platform heterogeneity provided by this operating system and hence it can be installed on different hardware platforms that TinyOS supports.