Foundations of Component-Based Systems