Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to create an object Map in a class diagram ?(Looking for a tutorial for creating an object Map in a class diagram)
How to create an object Map in a class diagram ? [message #1821154] Thu, 06 February 2020 11:54 Go to next message
Gregory Roche is currently offline Gregory RocheFriend
Messages: 11
Registered: February 2020
Junior Member
Hello,

I'm looking for a tutorial about class diagram with Papyrus.

I don't find how to create my diagram for generating the code bellow :

Map<String, IRobot> shapes = new HashMap<String, IRobot>();


Thanks.
Re: How to create an object Map in a class diagram ? [message #1821173 is a reply to message #1821154] Thu, 06 February 2020 14:28 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Maps are very much the poor relation of Collections in UML.

It is possible to use qualified associations, but you won't find very much tooling that supports it adequately. Certainly when I tried to get it working with EMF, I hit major limitations in EMF's EMap and gave up.

Alternatively you may define your own custom templated types, possibly targeted on the Map class added to Eclipse OCL in the last few years.

In my experience, collection/map classes are often just a pragmatism for more useful application classes. Once you start using an application class, the inadequacies of collections/maps vanish.

Regards

Ed Willink
Re: How to create an object Map in a class diagram ? [message #1821175 is a reply to message #1821173] Thu, 06 February 2020 15:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Sorry. A bit confusing. What I meant was that the typical Map.Entry<key : K, value : V> can be reified as MyEntry{key : MyKey, value : MyValue, more properties, useful operations} and maintained as a Set<MyEntry>.

Regards

Ed Willink
Re: How to create an object Map in a class diagram ? [message #1821181 is a reply to message #1821175] Thu, 06 February 2020 16:53 Go to previous message
Gregory Roche is currently offline Gregory RocheFriend
Messages: 11
Registered: February 2020
Junior Member
Ok, thank you for your answer.

I'm newbie under Papyrus. And I see what for the moment, I can obtain this simple code :

AClass<String>


I founded this tutorial on Youtube, but I haven't obtain the result :
https://www.youtube.com/watch?v=Z3u5fSWkP-A&list=PLQuZvNs1nWi03IRLNhtaW4Ul_Ego9Rp91&index=14&t=388s

I'm looking for an updated tutorial for creating Generics in Java ?

Thanks.


[Updated on: Sat, 08 February 2020 19:43]

Report message to a moderator

Previous Topic:SysML
Next Topic:How to custom representation of guard in sequence and state machine diagrams?
Goto Forum:
  


Current Time: Fri Apr 26 06:05:38 GMT 2024

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

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

Back to the top