Book a Demo

Author Topic: Accepting suggestions for depicting generics  (Read 2072 times)

Emilio

  • EA User
  • **
  • Posts: 78
  • Karma: +0/-0
    • View Profile
Accepting suggestions for depicting generics
« on: February 06, 2009, 09:22:42 pm »
OK, I am now open to some suggestions from UML gurus in hopes that somebody who have used that more often in UML + C#/C++ designs can give some "best practices". I am showing the equivalent C# code declaration just for the sake of clarity and not implying it is UML related.

I have a set of generic classes in the UML design. These make use of the "Parameterized" class feature. There for these generic classes I define a couple of generic parameters (known in C/C++ as "templates" and C# as "generics").  This I got under control.

         class MyGenericClass<R> { ... }

Now I want to define refinements of the generic classes  that make use of specific non-generic (defined) types. In the realization class I map the generic parameter R to a defined type MyCustomType.

         class  MyCustomType { ... }
         class  MyClass : MyGenericClass<MyCustomType> { ... }

So far so good, I can define all of those in UML. The question is now, since MyClass inherits from MyGenericClass and maps MyCustomType as the generic parameter of the later, how would I go about depicting MyCustomType as and association class in UML and EA? unless of course this is not considered a good practice.

I would like to do that because I want to show that relationship in the design so that the developers can interpret it without doubt.