Component systems comprise components linked in various ways. We illustrate an approach to expressing and selecting appropriate semantics for components, using as a starting point UML class diagrams. Like most diagrammatic notations, UML does not have a fixed interpretation. We present a meta-modular framework for the combined use of UML and Z, based on two levels. At the meta-level, we express modular semantic interpretation of UML diagrams by using templates and generics. At the instantiation-level, UML models are translated into Z specifications by instantiating the corresponding meta-level semantic interpretations. This allows the definition of semantic interpretations that are precise and unambiguous in a modular fashion, allowing tailoring of semantic interpretations by plugging-in or plugging-out modules representing some semantic aspect, and enhancing the readability, conciseness and abstraction of the resulting Z specification.