Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: zyx 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?
-
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
-
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?
-
2.2.0 Sup page 886
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
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.
A classifier is a metamodel class?
A classifier is a UML metamodel element, represented diagramatically as rectangle, refer Infra Language constructs.
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.
-
Bruce is correct, just wanted to add some refinements.
An Actor specialises BehavioredClassifier, which specializes Classifier.
So
Actor --|> BehavioredClassifier --|> ClassifierA classifier is a UML metamodel element, represented diagramatically as rectangle, refer Infra Language constructs.
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.
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