How to Develop Pervasive Social Applications with the SAPERE Middleware