Assembling Smart Cyber-Physical Systems