file Template Parameter

8 months 2 weeks ago #4854 by rear
hi @all,

how can I add a template paramter to a class or interface? (public class MyList<T> ... in Java)
I can not find anything under the existing registers (Properties etc)

thank you in advance,

rear

Please Log in or Create an account to join the conversation.

8 months 2 weeks ago #4856 by ebr
Hi rear,

You just have to right click on your Class or Interface and then select create Element > Template Parameter.



Hoping it helps,

EBR
Attachments:
The following user(s) said Thank You: rear

Please Log in or Create an account to join the conversation.

8 months 2 weeks ago #4857 by rear
Thank you very much for this info. So easy if you know how. :)

Please Log in or Create an account to join the conversation.

8 months 2 weeks ago #4858 by rear
Sorry, me again: Can you tell me, if I realize an interface or extend a class with a template parameter, where I can bind the template to a concrete type? In Java something like

public class ProductComparator implements Comparator<Product>

The only thing i can find is in the properties of the realization "Java Designer" -> "{} JavaBind". But this field is not shown in the diagram and I think this info is not java specific.

thank you again...

Please Log in or Create an account to join the conversation.

8 months 2 weeks ago #4863 by ebr
Hi rear,

You are right the template paramter binding can be model by using TemplateBinding link and a third Class.
But instead, we chose to model this information, for Java Generation, by using the JavaBind field which is much more simpler and practical.

Cheers,

EBR

Please Log in or Create an account to join the conversation.

Moderators: tmaebr
Time to create page: 0.132 seconds
^ Back to Top