Wireless Sensor Networks (WSN) represents an inherently more complex domain for the design and implementation of middleware than traditional Enterprise systems. Existing examples of middleware within WSN are limited in their scope and are primarily affiliated with influencing the behaviour of nodes only, with some middleware. being capable of operating at node and gateway level. We propose an Open Framework Middleware (OFM) that addresses these limitations. It is loosely based on the principles of Model Driven Engineering (MDE) and also incorporates some of the concepts of cloud computing's ubiquity and pervasiveness. It views the network as a single entity, that is a middleware operating at all levels of the network i.e. node, gateway and control level. It provides distribution, scalability, flexibility and adaptability at deployment, operation and integration levels.