What is the correct way to represent template classes with UML?

旧城冷巷雨未停 提交于 2019-11-26 20:27:57

Normal rectangle with a dotted rectangle in the top right corner, to represent the template parameter. Something like this:

           .......               
___________:  T  :
|          :.....:
|              |
|  ClassName   |
|              |
|______________|

A more useful approach is to use a UML Classifier for the Template. This is a UML Element that represents an extension to the UML notation. If your tool supports profiles create the Classifier within one. Define the Classifier for the Template, and include the properties and methods from the template, then instead of using the standard class notation, use the Classifier you have created for each Class that uses the template. This would be correct usage of the UML for Templates.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!