# An Aspect-Oriented Approach to Time-Constrained Strategies in Smart City IoT Applications
## 4 Benefits of Applying Our Approach in the Context of a Smart City  
In this research, we have proposed a method for managing time-constrained strategies at the granular level of functional decomposition. We also applied technological methods we developed in previous research [16; 36] to enable the updating of IoT device functionality at runtime at this granular level of functionality. In the context of smart cities, there are several areas where this approach improves upon existing methods. Firstly, the act of updating the IoT device's strategy and core functionality is in and of itself non-trivial in the context of the resource-constrained and heterogeneous nature of IoT software. Extant research efforts such as SUIT [26] focus on creating standards for updating device firmware. However, this approach is accompanied by complex security, maintenance, and scale considerations, as well as a need to manage the downtime of devices and services. Our approach to updating the device functionality is far more flexible, as we achieve this goal through the runtime injection of the necessary functional components directly into the object model using an out-of-band, aspect-oriented mechanism as shown in Figure 4. The disadvantage of our approach in comparison to firmware updates is that the dynamic nature of our approach does not provide for persistence. Thus, where IoT devices are reset, they must re-acquire any updates to their functionality at runtime. The specific characteristics of the smart city application will dictate where this is reasonable and where a persistent firmware update is more appropriate. Another area of improvement is in the decentralization of the update process and the potential for agents to learn strategies from each other. In the context and scale of a smart city, decentralized approaches provide benefits in terms of reliability, fault tolerance, availability, latency, and survivability. While decentralization is not exclusive to our approach, it is key to it insofar as agents may acquire up-to-date versions of strategy components from any other agent in the system. This capacity for the inter-agent sharing of strategies and their components lays a foundation for various artificial intelligence applications in which intelligent agents may communicate, co-operate, and teach each other better strategies for accomplishing tasks (Figure 5). The practical implementation of our proposed mechanism in a smart city should also include a plan for its security. Generally, security is an essential component of the design of any form of software update in a deployed/production environment. This consideration is compounded by the physical accessibility of devices across a smart city  
Figure 5: A smart city implementing an aspect-oriented mechanism which facilitates the synthesis of local strategies through inter-agent sharing of functional components in an MAS. and the corresponding challenge of physically securing both the devices and the access points to the smart city network which may run over the public internet. Additionally, the large number of IoT devices on the network and their heterogeneity make spoofing and the connection of unauthorized hosts a feasible method of attack. In the case of our proposed model, executable code is acquired from agents in a decentralized system. Thus, ideally, this code should be wrapped in a trust and verification mechanism prior to usage in the field. Security and trust in IoT systems are ongoing areas of research [39; 40; 41] which are outside the scope of this work. However, the ITM, which we propose to use as the basis for MAS communication in our approach, is designed to integrate into the OSI seven-layer model at the application layer. Trust, encryption, and other security technologies can, thus, be easily integrated into the Presentation and Session layers in our model. Another key area in which our approach improves outcomes in the smart city context is in terms of communications traffic, and, by extension, power consumption.