Programming Pervasive and Mobile Computing Applications with the TOTA Middleware