In this paper, we propose a systematic approach, based on the CSP process algebra, to preserve deadlock- and livelock-freedom by construction in I/O component composition. In contrast to existing classical approaches, we allow components to have complex behaviour, protocols and contracts. As a consequence, it is possible to predict the behaviour of a wide range of component-based systems prior to their implementation, based on known properties of the system components.