A semantic approach to component-based software