Middleware helps to manage the complexity and heterogeneity inherent in distributed systems. Traditional middleware has a monolithic architecture, which makes it difficult to adapt to special requirements such as those present in embedded applications. Middleware for small devices has to cope with a broad range of requirements as well as with the stringent resource constraints. In this paper we propose a family-based approach based on aspectoriented programming (AOP) for the implementation of middleware product lines which are highly configurable and adaptable. Such an adaptable middleware is statically configured according to the requirements of the specific distributed application. Furthermore, the middleware is also capable of adapting to the dynamics of the distributed embedded system by dynamically reconfiguring itself during runtime. An efficient dynamic aspect weaver is needed for this kind of adaptability. We also discuss a family of dynamic weavers that complements our study ...