Book a Demo

Author Topic: Accessing operations of a part classifier in SD  (Read 4924 times)

DavidR

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Accessing operations of a part classifier in SD
« on: February 07, 2012, 12:21:06 pm »
From the UML metamodel: a Lifeline in a Sequence Diagram may represent a ConnectableElement - i.e. a part in a Composite.
Correspondingly, SparxEA allows me to create Lifelines representing Parts by dragging a Part from a composite onto an Interaction Diagram.  However, it does not allow me to map messages to operations of the part's classifier (the operations button is disabled). The Part has been assigned a classifier and this is shown on the Lifeline.
This is a pretty fundamental way of modelling in a top-down decomposition: define the class and its operations, then define its internal structure and realise the operations as an interaction among its parts. This way you build up the operations required of the part's classifier.
Does anyone have a workaround?
Cheers,
David

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Accessing operations of a part classifier in S
« Reply #1 on: February 07, 2012, 05:54:16 pm »
David,

I just had a look at this, and it as far as I can see its working as expected.
- I Created a Class (Class3) and added a part (Part1) to it.
- Then I created another class (Class1) and I've set the type of Part1 to Class1.
- Then I defined an operation on Class1: TestOp()
- Then I created a sequence diagram and dragged Part1 onto it (as an instance of)
- Then I added a message to the lifeline of Part1 and I could select TestOp() from the dropdown box.

Makes perfect sense to me :-?

Geert

DavidR

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Accessing operations of a part classifier in S
« Reply #2 on: February 07, 2012, 10:32:58 pm »
Geert,

Thanks for the quick reply.
I followed your instructions and I still have the same problem.
I created the classes and part that you described.
Then I created a Sequence Diagram.
I dragged the Part from the ProjectBrowser onto the sequence diagram (instance or simple link makes no difference).
Create a message to self using QuickLinker. Message Properties dialog opens up => the "operations" button is disabled.
I've tried a number of variations on this.

Version: 9.2.921, Ultimate Edition.
Could there be a Preferences setting?

David

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Accessing operations of a part classifier in S
« Reply #3 on: February 07, 2012, 10:44:20 pm »
David,

The operations button is only there (in normal circumstances) to create new operations (or change existing operation). It opens the operations dialog for the class at the end of the message. In this case that would be the part, but since a part cannot contain operations it is disabled.

You should however be able to simply select the operation you need from the dropdown (without using the operations button).

Geert

DavidR

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Accessing operations of a part classifier in S
« Reply #4 on: February 07, 2012, 11:04:58 pm »
Geert,

Let me correct my post. I didn't understand what you meant by the drop down list. Yes, TestOp() does appear on the drop down list. As I said, the "Operations" button is still disabled.
This means that I can select existing operations of the Part's classifier but I cannot create new operations as I can if working with a direct instance of the Classifier.
I don't see why a Part should have less access to its classifier than an Instance. (Actually a Lifeline is not a TypedElement so I can't see how it is legal to assign a classifier to it in the first place.)
My main concern is a practical one. I want to decompose the classifier into parts; then realise classifier operations by interactions among the parts. I don't want to have to go to each Part's classifier to create the operation and then select that operation for the message.
Do you see any reason why I can't access the classifier operations from a part? It looks like a bug to me.

Cheers,
David


DavidR

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Accessing operations of a part classifier in S
« Reply #5 on: February 07, 2012, 11:29:16 pm »
Geert,

I don't agree with your argument re Part. As I understand the metamodel, a Lifeline itself is not a TypedElement. It is not typed by Property(Part) or any other classifier.
The only relationship between a Lifeline and a Classifier is via the "represents" relationship to a ConnectableElement. There should be no difference in the behaviour of Lifelines created by difference mechanisms.
BTW, MagicDraw allows me to create operations in a Part's classifier directly from a sequence diagram.

Cheers,
David

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Accessing operations of a part classifier in S
« Reply #6 on: February 08, 2012, 12:17:33 am »
David,

I'm not against enabling the operations button, I'm just saying that I understand why it is not at the moment (because you can't add operations to a part).

So if you'd like Sparx to implement that you'll have to send them a feature request

Geert

DavidR

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Accessing operations of a part classifier in S
« Reply #7 on: February 08, 2012, 06:35:56 am »
Will do Geert,
Thanks for your help.

David