The increasing diffusion of ubiquitous communication infrastructures and physical active objects --like sensors and smart tags-- is motivating the integration of these devices into advanced distributed systems. The novelty of these technologies has imposed a "code and fix" approach; only a few methodologies have been developed to address the integration of heterogeneous technologies to provide the user with sophisticated and flexible abstractions of real world objects. To this end, the paper proposes the first results of a model-driven approach for the development of applications based on heterogeneous physical active objects. We propose a metamodel and a framework for automatic code generation based on Jini. The approach is exemplified on a simple case study in the domain of advanced logistics.