Recent advances in wireless communications and microelectronics have enabled the development of low cost, low-power, tiny nodes that can be deployed anywhere, establishing communications among them, forming wireless sensor networks (WSN). Middleware have long existed before in many domains, and now they are being integrated in the WSN domain. Due to their particularities, middleware designed for WSN should obey certain design principles in order to function properly and efficiently. In this paper we present the majority of those design principles and we investigate the different approaches for middleware designed for WSN while giving our classification. Finally, a comparison of several middleware designed for WSN is drawn.