Book a Demo

Author Topic: Templates (parameterized class) and UML  (Read 1968 times)

mayac

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Templates (parameterized class) and UML
« on: July 15, 2004, 04:09:37 am »
 I am trying to write a class diagram for a system with templates, and finding it very difficult. I looked for information in the index help and found only one page which describes how to sign a class a template.
My question is which connector should I use in order to express a specialization  relation, and which one to express an instantiation one.

Example:
template <class T>
class G
{
public:
  T get(){return val;}
private:
  T val;
};

An instantiation:
typedef G<bool> Gbool;
How can I express the relation between Gbool and G in class diagram?

A specialization:
template<>
class G<MyType>
{
public:
  MyType get(){
return val;}
private:
  T val;
}