In this paper, we introduce MaDcAr, a model of engines for dynamic and automatic (re)assembling of component-based software. In MaDcAr, an application description consists of the definition of some valid configurations and the state transfer rules to apply during adaptations. This description is uncoupled from any implementation and can therefore be reused with other components. Given an application description, a MaDcAr engine builds a constraint solving problem that makes it possible to choose an appropriate configuration and the components to assemble. This choice takes into account the cost of the target configuration with respect to the available resources. To ensure the application consistency, the engine relies on the state transfer rules to initialize the component attributes of the target assembly using the component attributes of the source assembly. Key words: Automatic Adaptation ; Dynamic Adaptation ; State Transfer ; Uncoupling Components ; Configurations