Book a Demo

Author Topic: Template appearance for connectors not picked up?  (Read 6975 times)

TonyC

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Template appearance for connectors not picked up?
« on: February 02, 2022, 02:46:19 am »
I have a Templates package in which I have defined appearances for various elements including classes etc.

One of the elements I would like to set a template appearance for is the Association connector. This I have done (changed colour and line thickness).

When I create a new class diagram and place a new class on it, the new appearance for the class is carried through from the template package to my new class. However, when I try to place a connector onto the new class diagram it gets the default appearance, not the appearance that I have defined in the templates package.

Any thoughts on what I might be doing wrong here? Thanks in advance, Tony

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Template appearance for connectors not picked up?
« Reply #1 on: February 02, 2022, 11:41:24 am »
Hi Tony,

As you have discovered, relationships are second class citizens in the Sparxian universe.  IIRC, Template package appearance ONLY applies to Vertices (shapes).  Certainly, we don't have ANY relationships in our Templates package.

You will also discover that although the appearance of vertices can be changed when the default appearance changes, once created the appearance of arcs (relationships) is persisted as the actual appearance (rather than "take the current default appearance").

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

TonyC

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Template appearance for connectors not picked up?
« Reply #2 on: February 02, 2022, 08:22:27 pm »
Hi Paolo,

Many thanks for clarifying this. At least it is not that I have done something wrong. It's a shame because my users are impressed with the appearance of the shapes from my template, but then are equally disappointed by the appearance of the relationships!

I will raise an enhancement request with Sparx.

Regards,

Tony

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Template appearance for connectors not picked up?
« Reply #3 on: February 03, 2022, 11:55:06 am »
Hi Paolo,

Many thanks for clarifying this. At least it is not that I have done something wrong. It's a shame because my users are impressed with the appearance of the shapes from my template, but then are equally disappointed by the appearance of the relationships!

I will raise an enhancement request with Sparx.

Regards,

Tony
Hi Tony,
By all means, submit an enhancement request, but it might not surprise you to find that's been done a number of times over the past 25 years.


IN the meantime, our advice would be to use shapescripts to manage your relationships and items.  It will require your own MDG, but it looks like you are heading in that direction...


Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

TonyC

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Template appearance for connectors not picked up?
« Reply #4 on: February 03, 2022, 08:55:25 pm »
Hi Paolo,

Many thanks. I didn't really think I would be the first to have come across this, but maybe the more requests from users the more likely Sparx are to carry out the enhancement.

I note your comment regarding shapescripts for relationships. I do have a my own MDG Technology so will look to enhance that as you suggest.

Thanks again.

Tony

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Template appearance for connectors not picked up?
« Reply #5 on: February 04, 2022, 02:19:33 pm »
Hi Paolo,

Many thanks. I didn't really think I would be the first to have come across this, but maybe the more requests from users the more likely Sparx are to carry out the enhancement.

I note your comment regarding shapescripts for relationships. I do have my own MDG Technology so will look to enhance that as you suggest.

Thanks again.

Tony
Hi Tony,
When you decide to go down that route (NOT if... ;) ), let us know.  We have done a lot of research into using common code through our arc shapescripts by means of inheritance - thereby cutting down on our maintenance load.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

TonyC

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Template appearance for connectors not picked up?
« Reply #6 on: February 04, 2022, 08:17:54 pm »
Hi Paolo,

Many thanks for the offer of assistance. Now I know that the templates for arcs do not flow through, I have baselined it for now, as I have other priorities, but will pick up later when I can schedule it in.

Initial thoughts are that as we are mandated to use the Information Engineering (Crowsfoot) notation, I will need separate stereotypes (subtyped from the Association metaclass) with shapescripts for every combo of relationship (0:1, 1:1 ,1:many ,0:many ,many:many, etc) and that therefore these will have to be different connector types in my toolbox. Sounds a bit clunky, I'm sure you know of a better way...

Tony

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Template appearance for connectors not picked up?
« Reply #7 on: February 04, 2022, 10:52:47 pm »
Hi Paolo,

Many thanks for the offer of assistance. Now I know that the templates for arcs do not flow through, I have baselined it for now, as I have other priorities, but will pick up later when I can schedule it in.

Initial thoughts are that as we are mandated to use the Information Engineering (Crowsfoot) notation, I will need separate stereotypes (subtyped from the Association metaclass) with shapescripts for every combo of relationship (0:1, 1:1, 1:many, 0:many, many:many, etc) and that therefore these will have to be different connector types in my toolbox. Sounds a bit clunky, I'm sure you know of a better way...

Tony
Tony, 

Have a look at the Database Modelling.  You'll see it's all done with the same relationship metatype, but the shapescript reacts to the values of the multiplicity.

We use Crowsfoot notation extensively and have extended it to allow "0" and non-standard multiplicity.  Our shapescripts will draw the correct crowsfoot shape for the usual values, suppressing the multiplicity value.  For non-standard multiplicities., it draws a special shape and adds the actual multiplicity value as a label.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

TonyC

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Template appearance for connectors not picked up?
« Reply #8 on: February 04, 2022, 11:09:18 pm »
That's good news that the same metatype is used. Did you code the shapescript to react to the values of multiplicity or is that "built in" to EA?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Template appearance for connectors not picked up?
« Reply #9 on: February 05, 2022, 01:13:19 pm »
That's good news that the same metatype is used. Did you code the shapescript to react to the values of multiplicity or is that "built in" to EA?
Hi Tony,
You have to do it explicitly. It's not too hard, just a big structured conditional.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!