Correct and automatic assembly of COTS components: an architectural approach