In the domain of model driven engineering, patterns have emerged as an ubiquitous structuring mechanism. Actually, patterns are used for instance at the requirement analysis level, during system design, and during the deployment and code generation phases. In this paper, we are interested in making precise the use of such a notion during system design. More precisely, our ultimate goal is to provide a semantic framework to support correct by construction architectures, i.e., the structural correctness of the architectures obtained through the application of patterns. For this purpose, we propose an Event-B modeling scheme for hierarchical component models. This model is built incrementally through horizontal refinements which introduce components, ports and lastly connectors. Patterns with variability are defined, instantiated and applied to user models. We show that these operations preserve the structural properties of the component model.