## 4 Related Work
### Approach and Design  
As targeted in the aforementioned requirements, the application development should focus on the application logic instead of designing applications for specific devices. Appdaptivity enables the development of IoT applications independently of the physical infrastructure. Through a discovery process, the underlying physical infrastructure is part of the system and the application logic when it is available. Discovery can also be done in multiples scenarios thanks to the involvement of end users. In this case, discovery is dynamically done as a background process and the underlying physical infrastructure can be discovered in multiple contexts. Application logic only has to be done once and this discovery design enables the portability of these applications to multiple heterogeneous environments. Application portability is one of the key features of Appdaptivity. An abstraction has been adopted to categorise the underlying physical infrastructure and the context changes for end users: the location. The location refers to a logical abstraction where a physical infrastructure has been deployed, e.g., a room. Location enables the modelling of the real work as it has been conceived. All context changes that have happened in locations will be reflected in the application logic defined. This requires that the physical infrastructure has to support the location on their devices in order to correlate them with logical locations. Enabling the location on constrained devices can incur a loss of performance. Here, previous work has been exploited to force/encourage users to configure the location through a virtual resource [33], which does not impact on the resource-constrained devices' performance. Personalised applications are developed, exploiting previous work on managing access in resource-constrained environments [34], so that only authorised people can access devices. In the discovery process the underlying infrastructure is discovered which a target user has rights to, and the application logic will be fed with these updates. If a certain logic depends on an situation (e.g., temperature values), the application logic will not be activated until all the corresponding components have been received. Therefore, the application development can be globally done for all the personalised applications, since the application logic will be activated depending on the rights of each end user. App adaptivity has adopted a data flow programming model [19] to intuitively define user applications. In data flow programming, users define applications through a directed graph of nodes, modeling a flow of actions from which data should be taken. Nodes have a defined function which does not depend on other nodes, therefore they form highly portable and reusable components for the creation of applications. Application developers just need to concentrate on the application logic. Moreover, AppAdaptivity provides a large set of nodes to define user applications that can be created without having to program any lines of code. This mechanism is so non-technical users find it easier to use the system, which in turn facilitates the expansion of the proposed solution. Other frameworks provide some of the capabilities to develop device-decoupled, adapted changing contexts and personalised application. To the best of our knowledge this approach is the first to provide a framework for intuitively creating IoT applications that can be portable, personalised and adapted to changing contexts. App adaptivity comprises the Portability Core (PoCo), which is the component responsible for the data flow programming in an accessible and transparent Web UI. The PoCo enables location-based application development where users can define their applications. The resulting applications can be dynamically portable to other environments. An adaption for diverse deployment-scenarios has been taken into account and the PoCo offers a variety of deployments for different use cases.