I am admittedly an Enterprise Architect newbie. I'd like to model a template function but haven't found any resources that explain how to do so. The closest was another topic here on Stack Overflow that has no answers in over 2 years: UML template function modelling in enterprise architect
My goal is to implement a class that can handle data of any type but does not itself need to know details of the type. The outline of such a class would look something like the following:
class Foo {
public:
Foo();
~Foo();
template<typename T>
bool SendData(T const& data);
private:
int attribute1;
char attribute2;
}
I don't want to make this a template class as only one or two operations actually need (or should) to be generic. I know I could add a custom stereotype and modify the code generation templates, but I don't know how to do this "the right way." The best I can envision is applying some custom stereotype to an operation that ALWAYS prepends template <typename T>
verbatim to a method and has no room for flexibility.
Does anyone know the "correct" way to achieve this in Enterprise Architect?