Associtation types?

Hellu,

I don’t seem to be able to create a 1…* association :(… Please some help on that?

When I create an Association I want to indicate that it is a List or Map (Java) instead of a single Object type. How do I indicate this type?
I indicat the correct Multiplicity but if I change the Object Type then it will rename the target/source class :(…

I seem to have more problems with “types”, as I don’t seem to be able to use the java Map as argument type for an operation.
If I do something like operation(Map props), then the UML diagram will recognize this as parameter name “Map props” and type empty :(…

Please some adivce?

Regards,
Ed Bras

Hello edbras,

Thank you for your enquiry. In order to use Java collection class as type, you need to reverse engineer them into SDE as class models, and then select them as attribute type. Here are the steps in detail:

  1. Select Modeling > Instant Reverse… from the main menu.
  2. Reverse the source of JDK
  3. From the Class Repository tree, reverse the Map into Class Repository
  4. From the specification dialog box of the attribute, select Map as the attribute type

If I do something like operation(Map props), then the UML diagram will recognize this as parameter name “Map props” and type empty

This is not related to using Map as type but the way you enter the parameter. For UML presentation, you have to enter operation(props:Map) rather than operation(Map props).

Hope this helps.

Best regards,
Jick


reverse-map.png

Thanks mate, I will give it a try.

Regards,
Ed

Hmmmm…,

Still not completely successfull :(.
I imported the java classes from the source and can asign them now to an attribute (thanks for the nice explanation with the pics).

The problem I am having is connecting the association to the Map attribute.
If I open the association specification I indicate that Multiplicity of 1…* but the only Element is the “UserProperty” in my case which I think should be a Map, but I don’t know how to realize this and I can’t just change it (the last time I just renamed it, it started to rename my class and made a whole mess of it :frowning: ). So when I Choose to connect it to an attribute, the only choose that appears in the drop down is the “create attribute”… But that’s now what I want as I already have Map attribute that I want to link to :(…
If I choose to create an attribute it give my the “UserProperty” type and I can’t choose the Map :(…

How do I realize that?

One more thing: is it corect that the SDE (I have the latest version) still contains some major bugs ?
I mean, sometimes I get some realy unpredictabel result and not by making human mistakes. Sorry to say that…
For example: If I rename a class in the Class repository it won’t rename it in the code… and makes a mess of it… and the code and uml get out of sync… Can’t exactly remember what went wrong… but it took my a while to fix it :(…
Refactoring in the code and syncing it back into the model works great btw :wink:

Cheers,
Ed

Hello Ed,

Sorry that my suggestion was not helpful. About your need of generating association as Map, this will be available in our new code engine, which is still under development. About the problem of renaming a class model wouldn’t rename the class in code, are you able to reproduce it? If so, may I know the steps? Thank you.

Finally, I will inform you once the new code engine is ready.

Best regards,
Jick

Hellu,

Ok, to make sure I understood it correct: I can’t make a one-to-many association?? I find that a bit hard to imagine as isn’t this very basic?
Just a collection mapping?

How do you advice my to refactor?
So if I select a class in the uml model and click it again, I can safely rename it and then update code?.. Hmmm… I will try it… and let’s see how it goes…

Another thing I noticed a lot: when I am refactoring my classes in code and then choose “update Uml model”, some associations in my uml model are missing, they simple disappeared… :(… whereas they do exists in code. When I then draw the association again and choose to update the code again, the association is back but I do need to correct my code as it’s now implementing two times the same interface name :(… After correcting it in code and updating the um model again, the association stays…
weird…
It’s difficult to say exactly what I was refactoring at that time as I don’t check after every renaming the result in the uml mode…

Cheers,
Ed
PS: i will try to perform a SDE upgrade…

Hello Ed,

We support one-to-many association. But currently we can only handle it as array. We will support handling association as Java collection type.

Renaming a model and generating it to code should cause the code to rename.

About the last problem, I have made a few attempts and all works well. Maybe my sample is too simple. Could you provide me with the steps for producing it? Thank you in advance!

Once again, thanks for your post!

Best regards,
Jick

He there,

Thanks for your response (in the weekend).
When you thinkk that Maps associations are supported?..
And what are the consequences if I use them anyway in my code?.. apart from the array messages in the message pane.

Hmmm… I just updated my SDE to the lastest version online.
I just renamed a few packages to new names and allll contained classes on my uml class diagram of the renamed package are gone :(…
Why?

If you want to reproduce this problem, I think it’s easier if I just send you the whole project. (it’s not so big yet, I am just starting :wink: ).

I just renamed a class in my test SDE project in the Class Repository to another name as follows: select the class, press F2 and rename it. Then right mouse button on class repository root and choose “Update Project to code”. The change is visible in the class uml diagram but NOT in my code :(… (I also tried the “Force update to code”).

I hope this helps. Looking forward to your reaction,

Ed Bras

Another strange behavior that I experience:

When I lost all my uml classes in my class diagram and I drag them back in, he gives them all the same color: the blue color, the same as of the interface stereotype.
Wherever, as shown in the class diagram, they do have stereotype Implementation class which have another color, like he showed before.
When I then remove and add the implementation class stereotype, my correct color is back again.
Apparently there doesn’t seem to appear a auto update.

Regards,
Ed

Hi Ed,

We expect that the new code engine that supports Map will be available in June. Oh, by the way, if you want to try I can arrange an early access for you. The new engine is considered as much stable. Do you want to try?

The problem of losing format resulted from dragging and dropped stereotyped class back in is fixed, and will be available in Service Pack 1, which will be released in the next week. I will certainly inform you once it is ready.

Best regards,
Jick

He Jick,

Thanks for ur honest feedback.

Please inform me when the new engine is available and also when the new service pack is available as at the moment I have fallen back to my “old” trustfull MyEclipse-only-coding as my diagrams are f#ked up everytime I do something difficult which is unacceptable for me to work with…

Cheers,
Ed

hello Ed,

Sure. I will inform you when it is out.

Best regards,
Jick

Hello Ed,

How are you? I would like to inform you that the Service Pack of VP Suite 3.0 is released. It include the fix of missing shape format for stereotyped shape dragged from tree. You can run the updater inside the bin folder of VP Suite installation folder to advance to the latest version.

Enjoy!

Best regards,
Jick Yeung