## 4 Related Work
### Portability Core (PoCo)  
IoT applications are designed using the visual data flow framework provided by PoCo. These applications define the behaviours that will be rendered in the user applications without any configuration by end users, allowing the portability of them to multiple environments. The application developers only need to focus on high-level functionalities, rather than the implementation of low-level details of the underlying physical infrastructure. The service continuity can be a key challenge in applications with large IoT deployments since they can involve multiple heterogeneous networks. In that sense, the PoCo provides the mechanisms to maintain the service continuity in IoT applications independently the underlying physical networks used by the applications. Application can be portable to multiple environments and networks, thus applications are independent of the underlying physical devices and can adapt to the changing context without recompiling, keeping the service continuity of IoT applications in multiple scenarios. The discovery process used in Appdaptivity follows the OMA LightweightM2M (OMA LWM2M) standard [37], which enables the association of sensors and actuators with an open specification, i.e., resources are identified and organised based on the rules established in the standard. The use of standards allows a unified identification of resources. Nevertheless, apart from the OMA LWM2M standard, other standards like the IPSO Application Framework can also be added and used in Appdaptivity. In case of the adoption of another standard, the specification of the location resource should be configured in Appdaptivity according to the new standard. Moreover, user applications will have to integrate the standard in their UIs in order to know the type of behaviours received and display them accordingly. Moreover, CoAP discovery can be enhanced for supporting semantic matchmaking via inference services and logic languages like the SWoT framework [38]. The work flows that can be configured in Appdaptivity are not only restricted to location-based flows, they can also dispatch the resources belonging to the discovered RDs. Appdaptivity enables two main flows: the location and the building flows. Both flows take as input the resources discovered and the locations of each end points. The location flow is responsible for enabling the behaviours defined in one physical location no matter what RDs have been found; whilst the building flow enables the behaviours defined with all the locations in the RD received, e.g., an entire building. End users can establish their location, or just get their available behaviours in the building based on the last RD received. In order to reduce the number of communications with the RDs and CoAP servers, flows are only activated once end users have established their locations or start the building flow. On the other hand, personalised behaviours are crucial when the number of sensors and actuators increases. This is more important in scenarios where sensors and actuators are restricted, e.g., access control in secured areas. The Algorithm 1 shows an overall description of the update functionality in Appdaptivity. Once the IoT infrastructure is discovered, or there is any change in the environment, each active location in the location and building flow is checked to see if its corresponding IoT infrastructure has been changed. In the case that any flow has been changed, its behaviours affected will be updated and user applications will receive an up-to-date representation of them. When location or building flow are activated by user applications, they take the current status of the IoT infrastructure with its corresponding CoAP resources and will be up-to-date through this algorithm during its lifecycle.