A model-based approach for adaptable middleware evolution in WSN platforms