Book a Demo

Author Topic: Template Package Item Rendering outcome  (Read 3403 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Template Package Item Rendering outcome
« on: May 03, 2010, 08:33:56 pm »
It is generally accepted within the EA community (and I include the Sparxians in this) that you can create a Templates package to set the template (or default) attributes of a diagram or element. To quote the Help:
if you drop an unstereotyped element - a Class, for example - onto a diagram, Enterprise Architect searches the Templates package for a Class diagram that defines an unstereotyped Class, and applies that definition to the new Class.
And it's true, it does.  However, there are some (I would suggest) unintended consequences of this literal approach.

Say I change the rendering so that I change the fill colour of, say, that unstereotyped class above?  What is my intent?  I'd submit that I would wish that class to have the same rendering in all the diagrams I placed it on.  Any other interpretation of my intent would make the functionality (use case) somewhat pointless, no?

You can set the rendering of the unstereotyped class in two ways in the template Class diagram above:
via the Format Tool (View|Toolbars>Format Tool
and:
via Appearance>Default Appearance... [F4]

Now whichever mechanism I've used to get to this point, my intent clearly is that the new item to be created using the resultant rendering of the element shown on the diagram as it's Appearance>Default Appearance... [F4].  In other words, what I'm telling EA to do is to create the new item and then set the Appearance>Default Appearance... [F4] of that new element to the visible rendering of the item in the template diagram.  Any other outcome is (to me) non-sensical.  And yet, in true EAUI style... you get the non-sensical result.  EA just copies the settings into the new item, so that if you have different renderings via the Format Tool (View|Toolbars>Format Tool
and:
via Appearance>Default Appearance... [F4] then that's what you get... On the first diagram you get the rendering shown by the Format Tool (View|Toolbars>Format Tool and on any other diagram that you drag the item onto you get the Appearance>Default Appearance... [F4] rendering.

Now, one might argue (perhaps, if one was on planet Sparx) that this is the the appropriate behaviour.  To which my response is: they why not make this crystal clear in the Help that is is what will happen?  In any event - ONLY on planet Sparx could one suggest that I want to set the rendering of the item to one set (on an unknown diagram type - since the help DOESN'T mention what the target diagram is to be - only the purported1 source diagram) and a different set on any other diagram (by default)!  NOTE: I'm not suggesting that the item can't or shouldn't have different renderings on other diagrams only that the default rendering on the other diagram should be the same as that specified in the Template.

So the defect is that EA does not take the resultant rendering of the item on the Template diagram as the Appearance>Default Appearance... [F4] for the newly created item on the target diagram.

Reported,
Paolo
If you want to vote for a fix for this, submit a Registered Bug Report or Bug Report
with the same name, leaving a note here to say you've done it
 - so we users have an indication of the level of support.

1 To add insult to injury the source diagram for the item is NOT necessarily the diagram mentioned in the Help (or even a diagram at all)!  See: Template Package Item selected "by luck"
« Last Edit: May 03, 2010, 08:48:38 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!