Bug #50680 Change the behaviour of relationship caption when a table is repositioned
Submitted: 28 Jan 2010 7:51 Modified: 28 Jan 2010 9:27
Reporter: Perry Cappadocia Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S4 (Feature request)
Version:all OS:Any
Assigned to: CPU Architecture:Any
Tags: auto layout, caption, model, relationship, reposition

[28 Jan 2010 7:51] Perry Cappadocia
Description:
Scenario:
  When creating a relationship between tables, I rename then reposition the caption(s) that help describe the relationship.  I'm pretty sure that everyone else does this too.  When a diagram gets large, sometimes you have to reposition alot of tables to help make the diagram more readable. 

Current workbench behaviour:
  When a table is repositioned, the captions also move.  Both captions automatically reposition relative to the middle-segment. As such they also maintain a fixed spatial relationship to each other.

Problem with current workbench behaviour:
If a designer has to reposition many tables, or layers, (as often occurs) the captions tend to be repositioned in useless spaces between the two tables, often needing to be repositioned manually again.  This wastes time, and risks a caption being placed in a position that looks correct, but in reality is for a different table. This would be bad.

----
Possible rationale against current behaviour:
  The current repositioning behaviour only makes sense if the first and second captions are positioned to be read together (each caption relative to the other caption),and with some semantic reference to the other caption. I do not believe that this is the majority usage.

example: 'user'(has)'permission'  , 'permission'(is granted to)'users'

If the tables are laid out far apart, and if you keep the 'has' caption and the 'is granted to' caption near to each other, then the diagram reads oddly, with 'has' 'is granted to' in the middle, with cardinality information on the relationship endpoint. This is less effective to read than the alternative below.
---
Possible rationale for a change to a new behaviour:
  If the captions are positioned to be read as a descriptive table relationship with cardinality to another table (each caption relates to a table),and with some semantic reference to a table (which I think is most of the time), then the current repositioning behaviour is wrong.

example: 'user'(has)'permission'  ,  'permission'(is granted to)'users'

If the tables are laid out far apart and if you have a 1:M relationship between 'user' and 'permissions' and put the 'has' description near the permission table, and the 'is granted to' description near the user table, then you can read it as "one user 'has' many permissions", and "one permission 'is granted to' one user".

This idea is strengthened by the relationship details page.  You can see that when a relationship is described using a caption, there is a string that writes the semantic relationship between the reference table and referencing table  --> 'table1'()'table2'  and 'table2'()'table1'.  An example of this could be 'user'(has)'permission'. This of course makes sense.

How to repeat:
1)make 2 tables horizontally positioned across the diagram. VERY far apart.
2)make a relationship between them (cardinality doesn't matter)
3)make a caption for each end of the relationship, and position the captions near the table that it describes then relationship for.
4)manually reposition one table below the other.

At this time, it is obvious that you will see the captions to the far left and far right of the line. This need repositioning. 
----
repeat 1) to 3) 
4) manually exchange the positions of each table exactly.

At this time, the caption relationship for the first table is exactly in the caption position for the second table and vice versa. When reading this diagram, it looks reasonably correct, it is not obvious, and it would be completely wrong, perhaps costing a lot of $$ before it is discovered.
----
repeat 1) to 3) 
4) reposition one table to be much closer to the other.

At this time, the captions start to be positioned far outside the region of the diagram that would be useful for reading. requiring repositioning.

 

Suggested fix:
Crow's feet.
Fix:
Make the each caption positioning relative to the table end for which that part of the relationship is being described.

Rationale for fix.
With the current design, there exists only the middle-segment to reference the position of both captions.  This causes all of the repositioning anomolies described above.

New Initial Default behaviour:
When diagramming 'table1'()'table2', put the relationship description near the 'table2' side of the relationship.  When diagramming the inverse relationship, 'table2'()'table1', put the relationship description near 'table1'. Have some default parameters configurable in settings.

Minimal information required per caption:
I suggest that when a caption is initially created or manually repositioned, 2 pieces on information be recorded:
1)the absolute distance from the relationship endpoint (the table)that it describes.(offset from table). A positive value represents the location extending away from the table diagram side.

2)the absolute distance perpendicular from the relationship line.(offset from line). A positive value means the caption is below or to right of the line, negative is top/left. This way if the diagram line of the relationship switches from horizontal to vertical, or vertical to horizontal, then the caption stays on either the top and the left, or the bottom and the right. This also makes some sense to people who read left to right, or top to bottom, which is the norm.

With these two pieces of information, when a table is moved, the caption stays near it and moves with it as the endpoint moves, at a point on the relationship. The other caption stays stationary, relative to the other endpoint of the relationship.
[28 Jan 2010 9:27] Valeriy Kravchuk
Thank you for a reasonable and detailed feature request.