Author Topic: Advanced/Convert toInstance not working for Actors  (Read 6173 times)

qwerty

  • EA Guru
  • *****
  • Posts: 12449
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Advanced/Convert toInstance not working for Actors
« on: October 01, 2021, 08:13:42 pm »
When using the above option for classes EA creates an Object - as desired. But when doing that with an actor it again creates an actor being classified with the chosen one. It needs to be an object as well.

q.

P.S. Not reported. Only here...

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7616
  • Karma: +96/-18
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #1 on: October 04, 2021, 08:20:19 am »
When using the above option for classes EA creates an Object - as desired. But when doing that with an actor it again creates an actor being classified with the chosen one. It needs to be an object as well.
An InstanceSpefication is rendered using the same notation as its classifier with the addition of an underline under its name. EA has always internally represented instances of actor, use case and more as you have described.

The question is, why do you want the internal representation different? Are you still after the conformant notation or are you thinking that is wrong too?
Eve

support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8003
  • Karma: +211/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #2 on: October 04, 2021, 09:28:20 am »
When using the above option for classes EA creates an Object - as desired. But when doing that with an actor it again creates an actor being classified with the chosen one. It needs to be an object as well.
An InstanceSpefication is rendered using the same notation as its classifier with the addition of an underline under its name. EA has always internally represented instances of actor, use case and more as you have described.

The question is, why do you want the internal representation different? Are you still after the conformant notation or are you thinking that is wrong too?
Interesting,
As I read the UML specification (2.5.1) there is a certain amount of ambiguity around an InstanceSpecification

9.9.9 InstanceSpecification [Class]
includes...
An InstanceSpecification is a model element that represents an instance in a modeled system.
yet, one of its association  ends is:
specification : ValueSpecification [0..1]
Where...
A ValueSpecification is the specification of a (possibly empty) set of values. A ValueSpecification is a
ParameterableElement that may be exposed as a formal TemplateParameter and provided as the actual parameter in the
binding of a template.


Does that mean that the InstanceSpecification always specifies a single instance or a possible set of instances?

So far, it's not clear to me.  Thoughts?

If the former, then I think that's what qwerty meant.  If the latter, then I suspect that's not what qwerty meant.   I'll let him clarify.
The difference between an "object" and an "instance" is fraught with problems anyway.

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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7616
  • Karma: +96/-18
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #3 on: October 04, 2021, 10:39:18 am »
9.9.9 repeatedly says "the instance". I interpret that as singular.

I  don't find anything on an InstanceSpecification to specify a multiplicity, which even if it was derived from the number of values in the ValueSpecification I would expect it to be there if the intention was that it allowed multiple.

In contrast, if you look at the value property for a slot it's defined as 0..*.

What I was referring to was 9.8.4.
Quote
An InstanceSpecification is depicted using similar notation to its classifiers, but in place of the Classifier name appears
an underlined concatenation of the instance name (if any), a colon (:) and the Classifier name or names. The
convention for showing multiple classifiers is to separate their names by commas.

Paraphrased - An instance of an actor should be rendered to look like an actor.
Eve

support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8003
  • Karma: +211/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #4 on: October 04, 2021, 11:16:11 am »
9.9.9 repeatedly says "the instance". I interpret that as singular.

I  don't find anything on an InstanceSpecification to specify a multiplicity, which even if it was derived from the number of values in the ValueSpecification I would expect it to be there if the intention was that it allowed multiple.

In contrast, if you look at the value property for a slot it's defined as 0..*.

What I was referring to was 9.8.4.
Quote
An InstanceSpecification is depicted using similar notation to its classifiers, but in place of the Classifier name appears
an underlined concatenation of the instance name (if any), a colon (:) and the Classifier name or names. The
convention for showing multiple classifiers is to separate their names by commas.

Paraphrased - An instance of an actor should be rendered to look like an actor.[/b]
(my emphasis)
To be clear, I'm not disagreeing with that.  In or modelling environment, a specific instance looks like a placeholder instance (which is a form of classifier).

I'm asking about the nature of the specification.  If it can ONLY specify one specific instance then why not call it an instance?  We don't say ClassSpecification, ActorSpecification we just say Class and Actor?  Is it just Baroque language?

Just asking...

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

qwerty

  • EA Guru
  • *****
  • Posts: 12449
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #5 on: October 04, 2021, 05:58:13 pm »
I expect an Actor instance to be of metatype Object, not of Actor. Why have an Object for Class if you think that just setting the classifier would be enough? Because and instance is something different. Not just for Class.

q.

P.S. I roughly skimmed the UML specs now (often I took EA's implementation for the specs which is not correct in some cases) and they use InstanceSpecification rather than Object. Could that be some heritage?
« Last Edit: October 04, 2021, 06:05:18 pm by qwerty »

Modesto Vega

  • EA User
  • **
  • Posts: 640
  • Karma: +18/-8
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #6 on: October 04, 2021, 07:22:23 pm »
I think it is just baroque language, InstanceSpecfications are instances, section 9.8 of the specification starts as follows, with the key words highlighted in red.
Quote
9.8 Instances
9.8.1 Summary
InstanceSpecifications represent instances of Classifiers in a modeled system. They are often used to model example
configurations of instances. They may be partial or complete representations of the instances that they correspond to.
As to why the linguistic somersault, I have no idea.

Both classes and actors are objects, the beginning of section 11.4 reads as follows,
Quote
11.4 Classes
11.4.1 Summary
Class is the concrete realization of EncapsulatedClassifier and BehavioredClassifier. The purpose of a Class is to
specify a classification of objects
and to specify the Features that characterize the structure and behavior of those
objects.
The same does not apply to the definition or actor.

What I find terribly confusing is the beginning of section 9.2 defining classifiers because it implies that all classifiers classify instances not objects. Somehow, I would expect classifiers to classify objects and not instances.
Quote
9.2 Classifiers
9.2.1 Summary
A Classifier represents a classification of instances according to their Features. Classifiers are organized in hierarchies
by Generalizations. RedefinableElements may be redefined in the context of Generalization hierarchies.

A car is an object. My car is an instance of an object. An operator is an actor; Joe Bloggs operating a car is an instance of an actor operating a car object; Joe Bloggs operating his car is an instance of an actor operating an instance of a car.

qwerty

  • EA Guru
  • *****
  • Posts: 12449
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #7 on: October 05, 2021, 07:39:40 am »
Yes, thanks for the references :-) (busy these two days once after a year we have real meetings...) Indeed it's most confusing. I would not blame Sparx here. But somehow it would be nice to hear about how Sparx interprets those sections.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7616
  • Karma: +96/-18
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #8 on: October 05, 2021, 09:38:06 am »
I can only give my personal interpretation.

It's an InstanceSpecification because it's a modeled representation of a real world/software instance.

The specification explicitly comes into play when you look at the ValueSpecification that was asked about.

Code: [Select]
♦ specification : ValueSpecification [0..1]{subsets Element::ownedElement} (opposite A_specification_owningInstanceSpec::owningInstanceSpec)
A specification of how to compute, derive, or construct the instance.
Note that this is the 'specification' and even the value here is itself a specification.

A car is an object. My car is an instance of an object. An operator is an actor; Joe Bloggs operating a car is an instance of an actor operating a car object; Joe Bloggs operating his car is an instance of an actor operating an instance of a car.

This is what's going on here.
  • Joe's car and Joe Bloggs are real world objects.
  • Car and Operator are Classifiers in the model domain
  • operator is one end of an Association between Car and Operator
  • We can model Joe's car and Joe Bloggs as instances of Car and Operator
  • We can model Joe Bloggs as an operator of Joe's car by creating a Connector that is typed by the association above
  • At no point have we created Joe Bloggs or Joe's car. We have just represented what exists in our modeling domain
Eve

support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8003
  • Karma: +211/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #9 on: October 05, 2021, 12:14:05 pm »
I can only give my personal interpretation.

It's an InstanceSpecification because it's a modeled representation of a real-world/software instance.

The specification explicitly comes into play when you look at the ValueSpecification that was asked about.

Code: [Select]
♦ specification : ValueSpecification [0..1]{subsets Element::ownedElement} (opposite A_specification_owningInstanceSpec::owningInstanceSpec)
A specification of how to compute, derive or construct the instance.
Note that this is the 'specification' and even the value here is itself a specification.

A car is an object. My car is an instance of an object. An operator is an actor; Joe Bloggs operating a car is an instance of an actor operating a car object; Joe Bloggs operating his car is an instance of an actor operating an instance of a car.

This is what's going on here.
  • Joe's car and Joe Bloggs are real world objects.
  • Car and Operator are Classifiers in the model domain
  • operator is one end of an Association between Car and Operator
  • We can model Joe's car and Joe Bloggs as instances of Car and Operator
  • We can model Joe Bloggs as an operator of Joe's car by creating a Connector that is typed by the association above
  • At no point have we created Joe Bloggs or Joe's car. We have just represented what exists in our modelling domain
Oh... if only it were really that simple...  (actually simplistic).  But I don't want to get into a discussion about a theory of modelling which is supportable by EA, but isn't as simplistic as UML for real-world modelling.

However, I'd like to know what you meant by "At no point have we created Joe Bloggs or Joe's car. We have just represented what exists in our modelling domain".  I can't see the point of the statement (not criticising, just curious).
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 12449
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #10 on: October 06, 2021, 02:32:41 am »
I forgot to mention: if you drag an actor onto a diagram and choose the offered "As Instance" it creates an Object. So: why is the context menu not doing the same thing? If I smell a bug it's usually a bug.

q.

P.S. I looked into OMG's meta model and there is no Object metaclass either. But there is an InstanceSpecification which holds the description
Quote
An InstanceSpecification is a model element that represents an instance in a modeled system. An InstanceSpecification can act as a DeploymentTarget in a Deployment relationship, in the case that it represents an instance of a Node. It can also act as a DeployedArtifact, if it represents an instance of an Artifact.

Finally (for the moment) I looked into UML 1.5. There we do have the Object. So we have some heritage here, don't we?
« Last Edit: October 06, 2021, 03:59:37 am by qwerty »

Modesto Vega

  • EA User
  • **
  • Posts: 640
  • Karma: +18/-8
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #11 on: October 06, 2021, 04:40:16 am »
P.S. I looked into OMG's meta model and there is no Object metaclass either. But there is an InstanceSpecification which holds the description
Quote
An InstanceSpecification is a model element that represents an instance in a modeled system. An InstanceSpecification can act as a DeploymentTarget in a Deployment relationship, in the case that it represents an instance of a Node. It can also act as a DeployedArtifact, if it represents an instance of an Artifact.

Finally (for the moment) I looked into UML 1.5. There we do have the Object. So we have some heritage here, don't we?
From memory the UML 2.5.1 specification no longer has the concept on an Object as an Instance. This is why I wrote:
Quote
Both classes and actors are objects
and quoted the beginning of section 11.4 reads as follows,
Quote
11.4 Classes
11.4.1 Summary
Class is the concrete realization of EncapsulatedClassifier and BehavioredClassifier. The purpose of a Class is to
specify a classification of objects and to specify the Features that characterize the structure and behavior of those
objects.
In UML 2.5.1 all classifiers are used to classify objects and InstanceSpecification classifier is used to classify an Instance of an object - i.e., a classifier. Hence, my understanding is that in UML 2.5.1, any instance of a classifier should be depicted using the same notation as the classifier but with name underlined and, if a classifier has more than one instance, a relationship to classifier.

We could have some UML 1.5 heritage here.

However, I'd like to know what you meant by "At no point have we created Joe Bloggs or Joe's car. We have just represented what exists in our modelling domain".  I can't see the point of the statement (not criticising, just curious).
A model is a representation of reality, not reality. Like maps, models have scale; having a map or model with 1:1 scale is not possible. When modelling some problems it may be necessary to model Joe Bloggs or Joe's car, but this depends on the problem at hand; there will be problems where modelling Joe Bloggs or Joe's car, or modelling a car is not needed.

qwerty

  • EA Guru
  • *****
  • Posts: 12449
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #12 on: October 06, 2021, 08:36:22 am »
For me it boils down to the question: how is an instance in UML being shown? Graphically it will have the underline. But what will be the metatype of an InstanceSpecification? For UML 1.5 this was Object for sure. But that no longer exists. So, will it be InstanceSpecification instead? And would that mean that out old models must be migrated from one metatype to the other? I do have the feeling that yes.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7616
  • Karma: +96/-18
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #13 on: October 06, 2021, 10:59:15 am »
For me it boils down to the question: how is an instance in UML being shown? Graphically it will have the underline. But what will be the metatype of an InstanceSpecification? For UML 1.5 this was Object for sure. But that no longer exists. So, will it be InstanceSpecification instead? And would that mean that out old models must be migrated from one metatype to the other? I do have the feeling that yes.
That's an easy answer. You aren't going to see any change to how things are stored any time soon. We've had UML 2 for over 16 years, if we were going to change Object to InstanceSpecification that would have happened back then. The way they are stored is irrelevant.

Will we change the display of Object to Instance Specification? Probably not. Although I don't have any proof I expect it would cause more confusion than it would save.

We will continue to ensure that they behave and are rendered in a way compatible with the specification.
Eve

support@sparxsystems.com

qwerty

  • EA Guru
  • *****
  • Posts: 12449
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Advanced/Convert toInstance not working for Actors
« Reply #14 on: October 06, 2021, 07:49:50 pm »
Well then, what I expected. But how about the different reaction to "As Instance" from dropping and in the context menu? I'd rather see the context menu being a bug since for classes it will create an object like for dragging. But for actors is behaves exceptional.

q.