Book a Demo

Author Topic: Final and Abstract classifiers  (Read 16892 times)

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Final and Abstract classifiers
« on: October 04, 2019, 11:11:40 pm »
If I want to set a class to be an Abstract classifier, I am assuming that I need to set the Abstract property to checked. Is this correct?

If I want a class to be a Final Classifier, a classifier that cannot be specialised/sub-classed. Am I correct to assume that I need to check the Is Root checkbox? The wording of the help for Is Root and Is Leaf is not very clear.

Quote
Is Root
   
Select the checkbox to identify the element as being a root element that cannot be descended from another element.

Quote
Is leaf

   
Select the checkbox to identify the element as being final, so it cannot be a parent for other elements.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Final and Abstract classifiers
« Reply #1 on: October 04, 2019, 11:24:11 pm »
I think it's the other way.
Final = isLeaf

IsRoot would be for something like Object I guess

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Final and Abstract classifiers
« Reply #2 on: October 04, 2019, 11:26:26 pm »
UML 2.5 say on p. 99:

Quote
The isLeaf property, when true for a particular RedefinableElement, specifies that it shall have no redefinitions.

There is no IsRoot property defined in UML 2.5. So this is Sparx' little secret what it shall be used for.

To make an element abstract tick the Abstract mark in the Details properties section.

q.
« Last Edit: October 04, 2019, 11:29:25 pm by qwerty »

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Final and Abstract classifiers
« Reply #3 on: October 05, 2019, 12:52:46 am »
Thanks Geert and qwerty, I will settle with Is Leaf and would also love to know what the Is Root Sparx EA secret is for.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Final and Abstract classifiers
« Reply #4 on: October 05, 2019, 01:36:29 am »
Scrap that, Is Root makes a class Final Classifier. A class with the Is Root checked cannot have specialised another class.

Not sure about the purpose of "Is Leaf".

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Final and Abstract classifiers
« Reply #5 on: October 05, 2019, 03:16:11 am »
Scrap that, Is Root makes a class Final Classifier. A class with the Is Root checked cannot have specialised another class.

Not sure about the purpose of "Is Leaf".
That is just nonsense, opposite to what is described in the manual.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Final and Abstract classifiers
« Reply #6 on: October 05, 2019, 10:01:32 am »
Hi Modesto,
I think you may have misunderstood Sparxian.

isRoot, says the class cannot have been specialized from another class.  isLeaf, says the class cannot be specialized from.

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

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Final and Abstract classifiers
« Reply #7 on: October 07, 2019, 09:25:24 am »
isRoot was in UML 1.5 and we haven't got around to removing it yet (there's sure to be someone somewhere using it).

A Class where isRoot is set must not be the source of a Generalization.
A Class where isLeaf is set must not be the target of a Generalization.
The Sparx Team
[email protected]

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Final and Abstract classifiers
« Reply #8 on: October 07, 2019, 09:54:56 pm »
Hi Modesto,
I think you may have misunderstood Sparxian.

isRoot, says the class cannot have been specialized from another class.  isLeaf, says the class cannot be specialized from.

HTH,
Paolo
isRoot was in UML 1.5 and we haven't got around to removing it yet (there's sure to be someone somewhere using it).

A Class where isRoot is set must not be the source of a Generalization.
A Class where isLeaf is set must not be the target of a Generalization.

Let's see if we can translate Sparxian into normal English.

With isRoot set, a class cannot be the source of Generalization as  per KP reply but can be the target of Generalization. This means the class can be specialised but cannot be generalised, this what I think Paolo is saying. This is very useful to create an ontology model where the root cannot be further generalised.

The UML 2.4.1 specification states
Quote
isFinalSpecialization: Boolean
if true, the Classifier cannot be specialized by generalization. Note that this property is preserved through package
merge operations; that is, the capability to specialize a Classifier (i.e., isFinalSpecialization =false) must be preserved
in the resulting Classifier of a package merge operation where a Classifier with isFinalSpecialization =false is merged
with a matching Classifier with isFinalSpecialization =true: the resulting Classifier will have isFinalSpecialization
=false. Default is false.
I find this a bit confusing, but my original understanding it that I need to set isLeaf to True to prevent a class from been further specialised, which is Sparx EA behaviour. Whether, this makes it a Final Classifier I am not sure, let's say I have an ontology like (please note I am aware this may not be the best of examples):

Party (isRoot = True, isLeaf= False)
----Person
----Organisation
--------Internal Organisation (isRoot = False, isLeaf= True)
--------External Organisation

Party cannot be further generalised, intentionally or by accident, and Internal Organisation cannot be further specialised, intentionally or by accident. Which is class is the Final Classifier (Party or Internal Organisation)?

 

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Final and Abstract classifiers
« Reply #9 on: October 07, 2019, 10:07:37 pm »
First you have to give your definition of "final".

A leaf has one final root. A root has many final leafs. Given a tree, and not a graph.

q.
« Last Edit: October 07, 2019, 10:12:00 pm by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Final and Abstract classifiers
« Reply #10 on: October 07, 2019, 10:21:43 pm »
Your Internal Organisation would be Final (as used in Java) In C# the same concept is called Sealed
I don't think such an equivalent exists for isRoot (which is not in UML 2.5 anymore anyway)

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Final and Abstract classifiers
« Reply #11 on: October 07, 2019, 11:23:02 pm »
Your Internal Organisation would be Final (as used in Java) In C# the same concept is called Sealed
I don't think such an equivalent exists for isRoot (which is not in UML 2.5 anymore anyway)

Geert
So qwerty was right in the 1st instance, isLeaf is used to set a class as Final Classifier.


Having said this I am more interested in the isRoot because it prevents further generalisation, accidental or intentional. I think I read the UML quote as meaning that, in this example, Party is the final classifier. I find the UML quote also very Sparxian.