How can I imagine inheritance from a template parameter in UML?

Using UML, how can I imagine A< Foo >in the following code?

template< class T > 
class A : public T
{
    /* ... */
};

class Foo { };

A< Foo > a_foo;

Something like this (apologies for the bad art of ascii ... and Jon Skeet ) is my first guess, but I suspect this is wrong.

            ________________
            |              |
            |              |
            |     Foo      |
            |              |
            |______________|
             /:\  /|\
«bind»(Foo)   :    |
              :    |   .......               
            __:____|___:  T  :
            |          :.....:
            |              |
            |      A       |
            |              |
            |______________|
+5
source share
2 answers

There is a proposal from UML designers, but, nevertheless, this is not part of the standard.

If there were no template parameters, an object "a" of type "A" could be like this:

+--------------------+
|        a: A        | 
+--------------------+
| [+] doSomething(); |
+--------------------+

Object "a", which is a template "a", with a parameter of type "Foo", can be represented as follows:

                  +-----+
+-----------------| Foo |
|                 +-----+
|        a: A        | 
+--------------------+
| [+] doSomething(); |
+--------------------+

, U.M.L., , , , "a", . " ".

.

+1

, , "", Enterprise Architect:

      +---------+
+-----| T:class |
|     +---------+
|        T |
|   A      |
+----------+
|          |
+----------+

.

+1

All Articles