Book a Demo

Author Topic: Template Binding  (Read 5787 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Template Binding
« on: June 08, 2006, 06:56:40 am »
In other posts there's been some discussion about template binding.

Both the [size=13]UML 2.1 Superstructure[/size] Specification  and the [size=13]UML 2.0 Superstructure[/size] Specification are somewhat coy about exactly what kind of a beast a template binding is.

The specifications (section 17.5.3 TemplateBinding (from Templates)) say:
Notation
A TemplateBinding is shown as a dashed arrow with the tail on the bound element and the arrowhead on the template and the keyword «bind».

The diagram Figure 430 (in 2.0) or Figure 17.19 (in 2.1) shows what appears to be a Realization with a stereotype.

It would seem reasonable that a template binding be a specialized Realization.

Thoughts?

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

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Template Binding
« Reply #1 on: June 08, 2006, 11:45:51 am »
Hi Paolo,

A few 0.01 CAD worth...

Interesting musings, and I think I see where you are going.

As to the <<bind>> notation, within the EA world this seems to be how you would indicate this. I don't (off hand) think that EA explicitly recognizes keywords in the UML Superstructure sense (per Appendix B of either 2.0 or 2.1). However, it does seem to come up with the same results, and that's much of what counts. [Yes, I'd very much like to see this formalized. It would likely mean breaking the "keywords" feature of the current EA, so perhaps we could push this for version 7.0. Sounds like breaking changes are overdue in a number of areas anyway.]

[In the following, I am using the final 2.0 Superstructure specification: http://www.omg.org/cgi-bin/doc?formal/05-07-04 and the same version of 2.1 as you reference. The references are the same in both.]

Take a look at the following diagrams:
7.3 Root diagram of the Kernel Package
7.15 Contents of Dependencies Package

This gives us the big picture. Dependency is a specification of DirectedRelationship, which in turn specializes Relationship. Note that Dependency also specializes PackageableElement, and thus inherits some additional properties.

Now take a look at diagram 17.17. Here we see that TemplateBinding specializes DirectedRelationship, but has no other parents.

Thus, the 'relationship' between TemplateBinding and Dependency is more between (partial) siblings than a sort of "is-a" thing.

I have not had the time to go through all the children of DirectedRelationship - which is itself an abstract class - to determine if they all use the dashed line notation. Perhaps they do, and this is where the presentation similarity originates.

Any deeper than that I cannot help with. I'd probably pass the question to you at that point in any case.

David
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Template Binding
« Reply #2 on: June 08, 2006, 05:48:34 pm »
Quote
[size=13][SNIP][/size]
[In the following, I am using the final 2.0 Superstructure specification: http://www.omg.org/cgi-bin/doc?formal/05-07-04 and the same version of 2.1 as you reference. The references are the same in both.]
Yes, I've now downloaded  the [size=13]UML 2.0 Superstructure (formal)[/size] Specification, so we can talk from the same hymn book.
Quote
Thus, the 'relationship' between TemplateBinding and Dependency is more between (partial) siblings than a sort of "is-a" thing.
Yes, I now agree.

However, given that for the present, EA doesn't directly support TemplateBindings, I think using a Realization with a «bind» stereotype might be the best solution.

What do you think David?  (or anyone else for that matter)

Paolo
« Last Edit: June 08, 2006, 05:49:42 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Template Binding
« Reply #3 on: June 08, 2006, 07:46:38 pm »
Quote
given that for the present, EA doesn't directly support TemplateBindings, I think using a Realization with a «bind» stereotype might be the best solution

I was sort of groping around there, but I think you've crystallized it nicely. Given the point EA is at, and given how their implementation works, this appears to be the correct choice for now.

But... Try stereotyping a simple assocaition as <<bind>> and see if EA picks it up. If so, that's a better solution.

There is also (or will there will also be) an issue of CCC, although more subtle than most. OMG is not helpful about (UML) keywords. We need to think through a means by which these can be implemented within the CCC dictates.

David
No, you can't have it!