Theory of UML and design patterns