Book a Demo

Author Topic: Actors in sequence diagram  (Read 10964 times)

zyx

  • EA User
  • **
  • Posts: 95
  • Karma: +1/-1
    • View Profile
Actors in sequence diagram
« on: October 08, 2009, 12:17:42 am »
Hello,

    I apologize for my english, I am brazilian. I received the information that actually actors do not make part of the sequence diagram. They belongs only to the use case diagram. The use of actors in the sequence diagram is only a convention, in the metamodel UML actors exists only in the use-case diagram, so using actors in a sequence diagram is wrong?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13522
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Actors in sequence diagram
« Reply #1 on: October 08, 2009, 12:25:13 am »
No, I don't think having an actor in a sequence diagram is wrong.
If we look at the UML specification we see that
- Actors are classifiers
- Sequence diagrams contain lifelines, which are related to classifiers
- UML does not dictate which type of objects you can put on which type of diagram.

I would recommend however to use instances of actors in sequence diagrams, rather then the actors themselves.

Geert

zyx

  • EA User
  • **
  • Posts: 95
  • Karma: +1/-1
    • View Profile
Re: Actors in sequence diagram
« Reply #2 on: October 14, 2009, 12:29:17 am »
Geert,

    Thank you very much for the information. May you send me where I can find this information that says an actor is a classifier? I search in the UML 2.2 superstructure document and I didn't found it...

     Which is the difference between a classifier and a class? A classifier is a metamodel class? And which is the difference between a lifeline and an object? It is the same?

son-of-sargasso

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Re: Actors in sequence diagram
« Reply #3 on: October 14, 2009, 09:29:56 am »
2.2.0 Sup page 886
Quote
16.3.1 Actor (from UseCases)
An actor specifies a role played by a user or any other system that interacts with the subject. (The term “role” is used
informally here and does not necessarily imply the technical definition of that term found elsewhere in this specification.)
Generalizations
    • “BehavioredClassifier (from BasicBehaviors, Communications)” on page 434
Quote
Which is the difference between a classifier and a class?
A class is a (specializes) classifier with certain named features (Super sec 7.3.7)  i.e. many UML things can be classifiers, a class is one of them.
 
Quote
A classifier is a metamodel class?
A classifier is a UML metamodel element, represented diagramatically as rectangle, refer Infra Language constructs.
Quote
And which is the difference between a lifeline and an object? It is the same?
No.  A lifeline is a representation, in a UML diagram, of specific temporal features of an object within a system.  An object is an object, which is an instance of a classifier within a system.
From Paolo, "the diagram is not the model"!
hth
bruce

p.s. on the subject of using objects not classes in Seq diagrams.  Such a diagram may have n instances of a particular classifier in it.  Since EA only allows one instance of a class in a diagram  :-X you will need to use instance elements if your diagram includes more than one instance of a class communicating with another (either directly or indirectly).  Therefore always use instance elements, not classifier elements in a Seq diagram.
« Last Edit: October 14, 2009, 09:38:19 am by barrydrive »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13522
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Actors in sequence diagram
« Reply #4 on: October 14, 2009, 06:07:13 pm »
Bruce is correct, just wanted to add some refinements.

An Actor specialises BehavioredClassifier, which specializes Classifier.
So
Code: [Select]
Actor --|> BehavioredClassifier --|> Classifier
Quote
A classifier is a UML metamodel element, represented diagramatically as rectangle, refer Infra Language constructs.
Quote
Actually Classifier is an abstract metaclass. This means that you will never find just a Classifier in a model, only instances of its sub-metaclasses such as Actor, Class, Usecase,...
All classifiers however have the same default rectangular notation like we all know it from a Class.

Quote
No.  A lifeline is a representation, in a UML diagram, of specific temporal features of an object within a system.  An object is an object, which is an instance of a classifier within a system.
From Paolo, "the diagram is not the model"!

p.s. on the subject of using objects not classes in Seq diagrams.  Such a diagram may have n instances of a particular classifier in it.  Since EA only allows one instance of a class in a diagram  :-X you will need to use instance elements if your diagram includes more than one instance of a class communicating with another (either directly or indirectly).  Therefore always use instance elements, not classifier elements in a Seq diagram.

Another reason, somewhat less pragmatical:
In most cases the lifelines you create on a sequence diagram should represent objects (InstanceSpecification) rather then classifiers.
Why?
In your messages on a sequence diagram you will most likely be calling methods on the lifelines which correspond to operations defined on the classifier.

If such an operation is not declared static then you can only call those methods on an instance of the classifier. (EA will not enforce this rule!)

Only static operations are implemented on the classifier and can be invoked as such without the need for an instance.

So as you see there is a semantical difference between having an instance or having a classifier as a lifeline in a sequence diagram.

Geert