Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » How to add a map with generics?
How to add a map with generics? [message #1764654] Thu, 01 June 2017 04:14 Go to next message
Eclipse UserFriend
Hi,
I use Ecoretools and want to add a java.util.Map to my model with the key type java.lang.String and the value type my.ClazzType where my.ClazzType is also part of the same model.

I want to use the map as attribute in one of my classes of this same model.

What steps do I have to follow to add this in the class diagram?

With regards,
Udo
Re: How to add a map with generics? [message #1764660 is a reply to message #1764654] Thu, 01 June 2017 04:46 Go to previous messageGo to next message
Eclipse UserFriend
Hi

Maps are not one of EMF's strongest facilities. I failed to use them for many years but eventually felt guilty and tried again. You can find an example and some of my troubles in

https://bugs.eclipse.org/bugs/show_bug.cgi?id=443021
https://bugs.eclipse.org/bugs/show_bug.cgi?id=443195

To be honest, my recommendation is that if you want non-trivial efficient Maps you consider implementing them by manual coding behind a modeled API in the generated Java classes.

Regards

Ed Willink
Re: How to add a map with generics? [message #1764669 is a reply to message #1764660] Thu, 01 June 2017 05:33 Go to previous message
Eclipse UserFriend
See https://wiki.eclipse.org/EMF/FAQ#How_do_I_create_a_Map_in_EMF.3F for details. You can accomplish the same tasks as described in the FAQ using the Ecore Tools editor. It obviously works because Ecore itself uses it and we have many cases of using it in Oomph's setup models.
Previous Topic:Question Generating from XSD
Next Topic:EMFStore on Tomcat: How to set it up using MongoDB?
Goto Forum:
  


Current Time: Thu Jun 12 15:49:34 EDT 2025

Powered by FUDForum. Page generated in 0.03031 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top