**4. Discussion**

As described in Section 2 and then pointed out by presenting three relevant adaptations of xCARE in Section 3, the proposed platform can be easily customized and adapted to develop smart and pervasive healthcare systems. Our lessons learnt coming from the development and adoption of this generic architecture is that from a software engineering perspective the tasks to be done to develop a healthcare system are almost always the same as the functionalities to be provided. On the contrary, what changes from an application to another is related to personalization, usability, and intelligent support. This conclusion clearly supports the definition of a generic development platform, such as xCARE.

Thinking on the xCARE microservices as LEGO pieces, any new application can be built by composing them according to the requirements. Continuing with such metaphor, what differentiate each application is which pieces are used, how they are combined, their color, and the final aspect as a whole. Accordingly, first, a co-design approach should be performed involving the final users (at any level), domain experts (i.e., healthcare professionals), technicians, and user experience experts. In doing so, the specific front-end for that application will be designed and the usability issues will be taken into account at the very beginning. Once all the needs have been collected, the xCARE software engineer gathers the requirements, selects the microservices already available, defines those that are not, and designs the overall architecture. In parallel, the IoT programmers develop the interface for the connection with the required devices (if not already available) and the artificial-intelligent team defines the models for providing personalized and intelligent support to the final users.

It is worth noting that the adoption of this kind of solution is very effective for rapid prototyping, because the final users can have a first version available in very few time. Thanks to its modularity, the corresponding application is robust to changes in requirements, thus supporting application development in which different actors are involved. Finally, it can be scaled-up easily by simply adding new microservices/ functionalities or by delegating tasks and functions to additional microservices.
