This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 230101 - Enhencement request: ordered associations in instance diagram
Summary: Enhencement request: ordered associations in instance diagram
Status: VERIFIED FIXED
Alias: None
Product: Tigerstripe (Archived)
Classification: Technology
Component: Diagrams (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 0.3M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-04 03:35 EDT by Yoram CLA
Modified: 2011-02-01 14:22 EST (History)
4 users (show)

See Also:


Attachments
Ordered associations (21.57 KB, image/png)
2010-12-01 17:20 EST, Navid Mehregani CLA
no flags Details
230101 class diagram (13.95 KB, patch)
2010-12-30 09:06 EST, Anton Salnik CLA
no flags Details | Diff
230101 patch (290.69 KB, patch)
2011-01-20 01:25 EST, Anton Salnik CLA
no flags Details | Diff
230101_c12 patch (47.78 KB, patch)
2011-01-28 07:00 EST, Anton Salnik CLA
no flags Details | Diff
230101_c15 (88.77 KB, patch)
2011-02-01 07:39 EST, Anton Salnik CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yoram CLA 2008-05-04 03:35:26 EDT
It would be mighty nice to have the ability to specify the order of ordered association and to have this shown on instance diagram.

This request can be extended to all ordered items in a model (but the above is really missing)

Thanx!
*Yoram
Comment 1 Yoram CLA 2010-11-07 05:55:39 EST
This request has now become quite important. In order to document certain use cases it is essential that ordered associations and association class can be displayed on the diagram *with the order* shown. Some of my diagrams are meaningless without the order (I decorate with tex now but this is really lame).

Is there a plan to address this request at some near future date?

===
I can suggest that for flat associations, the order would show up as an enumerator next to the label of the ordered end. Note that if the latter, I should be able to delete the label of the end name but leave the enumerator on the diagram

To be consistent I propose that the same behavior (association end label enumerator) would be manifested for association classes (no additional attribute!)

It is highly desired to be able to edit the enumerator and assign an arbitrary value to it.
===

Thanx!
*Yoram
Comment 2 Eric Dillon CLA 2010-11-08 11:53:19 EST
(In reply to comment #1)
> This request has now become quite important. In order to document certain use
> cases it is essential that ordered associations and association class can be
> displayed on the diagram *with the order* shown. Some of my diagrams are
> meaningless without the order (I decorate with tex now but this is really
> lame).
> 
> Is there a plan to address this request at some near future date?
> 
> ===
> I can suggest that for flat associations, the order would show up as an
> enumerator next to the label of the ordered end. Note that if the latter, I
> should be able to delete the label of the end name but leave the enumerator on
> the diagram
> 
> To be consistent I propose that the same behavior (association end label
> enumerator) would be manifested for association classes (no additional
> attribute!)
> 
> It is highly desired to be able to edit the enumerator and assign an arbitrary
> value to it.
> ===
> 
> Thanx!
> *Yoram
Navid? Could you work with Yoram to gather all the details needed and bump this up in our priority list?

Thanks,
Eric
Comment 3 Navid Mehregani CLA 2010-12-01 17:20:46 EST
Created attachment 184313 [details]
Ordered associations

I've clarified this with Yoram after a few E-mail exchanges a couple of weeks ago.  Here's the final requirements that we concluded on:

- When an association end is ordered, we indicate this via a label in class diagram (e.g. {ordered}) User will be able to hide/show this label in diagram

- If an instance of an association or association class is created in an instance diagram that has an ordered association end, user will be able to right click on association > select 'Set Order' > aEnd or zEnd (disable where appropriate) > and set an arbitrary order on the corresponding association end.  This label can be hidden/shown similar to other association labels.
Comment 4 Navid Mehregani CLA 2010-12-01 17:22:12 EST
Yoram, I'm prioritizing the list of defect/enhancements for I27.  How important is this enhancement to your work? Should I schedule it in I27?
Comment 5 Yoram CLA 2010-12-02 08:49:14 EST
(In reply to comment #4)
> Yoram, I'm prioritizing the list of defect/enhancements for I27.  How important
> is this enhancement to your work? Should I schedule it in I27?

Navid, if you're asking me to prioritize it I need to know what to prioritize it against. It would be nice to have (and would make some of my diagrams much better looking but if there are other features in the candidate list then I may prefer something else. If this is the ONLY feature on the list then its priority is the highest and lowest at the same time...
*Yoram
Comment 6 Navid Mehregani CLA 2010-12-02 09:48:30 EST
Fair enough.  I don't think I'll schedule this enhancement just yet.  Hopefully we'll get to it in the next couple of iterations.
Comment 7 Anton Salnik CLA 2010-12-30 09:06:11 EST
Created attachment 185909 [details]
230101 class diagram

Patch for ordered associations on class diagrams.
Comment 8 Anton Salnik CLA 2011-01-20 01:25:29 EST
Created attachment 187167 [details]
230101 patch
Comment 9 Yuri Strot CLA 2011-01-24 04:08:56 EST
"230101 patch" applied.
Comment 10 Navid Mehregani CLA 2011-01-24 13:44:59 EST
I see multiple issues with this feature.  Here's what I did:
 - Create a Model project called p1
 - Create two entities A and B
 - Created an association between A and B and modified the aEnd to specify a multiplicity of 0..* and set 'isOrdered' to true.


When all artifacts are added to class diagram, the aEnd doesn't get decorated with '{ordered}' label as requested by this enhancement.  Note that user should have the ability to filter this label via 'Hide/Show Details' context menu option.


I then create an instance diagram > Add entity A to diagram > Right click on Entity > 'Add Related Instances...' > Select B > OK.  Right click on association > Set Order > aEnd > The 'Set Order' dialog displayed is not in the expected format.  There should just be a label called 'Order Type' with a text box that accepts an arbitrary value.  When user enters the value, it should appear as a label on corresponding aEnd/zEnd of association.  User should have the ability to hide/show this label via 'Hide/Show Details' context menu option similar to class diagrams.

This enhancement can be moved to I30 if there aren't enough cycles to complete it in I29.
Comment 11 Anton Salnik CLA 2011-01-25 08:40:14 EST
Sorry, I didn't leave any comments about implementation details.
Order qualifiers could be enabled/disabled from "Hide/Show -> Hide Order Qualifiers" diagram context menu (similar to Stereotypes). By default the order qualifiers are hidden. Instance diagram has the same menu.

I assumed that order can be specified by an integer value only. So in "Set Order" dialog you could specify a custom order number or if you have n associations you can sort them, in this case assigned order values will be from 1 to n. If order number isn't specified then displayed value is "unknown".
Comment 12 Navid Mehregani CLA 2011-01-26 10:53:15 EST
Anton, the Set Order dialog should have a free form text field where the user can enter any order they wish (text or integer).  Whatever that's entered should be displayed as a label in the instance diagram.  

Yoram, if you like to propose a different solution, please comment.
Comment 13 Anton Salnik CLA 2011-01-28 07:00:13 EST
Created attachment 187831 [details]
230101_c12 patch

Set Order dialog updated, now it contains only free form text field.
Comment 14 Yuri Strot CLA 2011-01-28 07:43:00 EST
Applied 230101_c12 patch.
Comment 15 Navid Mehregani CLA 2011-01-28 15:53:01 EST
Hey Anton, just tried this out.  I don't see a label in the class diagram when 'isOrdered' bit is set.  
In an instance diagram, I don't see the order value that's set via Set Order dialog.  

Let's discuss on Monday.
Comment 16 Anton Salnik CLA 2011-02-01 07:39:27 EST
Created attachment 188038 [details]
230101_c15

Order qualifiers are enabled by default. Menus for enabling/disabling order qualifiers are moved from diagram menu to association context menu.
Comment 17 Yuri Strot CLA 2011-02-01 08:01:36 EST
Applied 230101_c15 patch.
Comment 18 Navid Mehregani CLA 2011-02-01 14:22:03 EST
Excellent Anton! It now works as expected.
Yoram, you may also want to try out this feature once the push is completed tomorrow.