Composition of UML class diagrams using category theory and external constraints