Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: NothanUmber on March 01, 2004, 10:48:50 am

Title: Scenarios as instances of use cases
Post by: NothanUmber on March 01, 2004, 10:48:50 am
Is it possible to create a graphical representation of a scenario as an instance of a use case? If I insert a use case via "as instance of element(object)" I only get the use case itself. (The same operation on actors gives me an instance of this actor, on classes a corresponding object etc.) If that's not possible: Exists there some sort of workaround?
Title: Re: Scenarios as instances of use cases
Post by: sargasso on March 01, 2004, 05:28:44 pm
An interesting concept!  What does it represent?

Anyway:

1) Create a new collaboration element called scenario name
2) Create a realisation link to the use case
3) Right click on the collaboration and select "Set Instance Classifier"
4) set the classifier to the use case
5) Use Element/Change Type to change the collaboration to a use case

Suggest you also set the stereotype of the scenarios to <<scenario>>.
Title: Re: Scenarios as instances of use cases
Post by: angel-o-sphere on March 05, 2004, 06:26:38 am
I would use a similar approach, but of course NOT a Collaboration, but a Class/Object.

Create an object from the class diagram toolbar and link it with an dependency to the Use Case.

Now either use <<instance_of>> or <<instanciates>> as stereotype for the dependency or use the "instanciates" property of the object to refer to the Use Case.

Finally the object should have the stereotype <<scenario>>. Well, UML 2.0 offers a standard scenario element as top level MOF instance.

Why not to use a Collaboration? Well, if we look at a classes only then we have this hierachy:
Interface
Class
Object
with this relations:
Class realizes Interface
Object instanciates Class

For Use Cases this breakes a bit but is more or less like this.
Use Case
Collaboration
Scenario
with relations:
Collaboration realizes Use Case (and aggregates a set of classes or a package)
Scenario instanciates Use Case

The break is, because the realization and instanciates relation are not analogous to the Interface <- Class <- Object relations.

A scenario is in no way related to the Collaboration realizing the Use Case, because EVERY realization, regardless how implemented, has to perform the same in respect to the scenario.

A Collaboration is a definition for an implementation.
A Scenario is a possible instance of the specification. While the Use Case is the set of all possible scenarios/specifications.


Well, you could also use something totally different: I use the "Requirement" from the Custom Tab of EA as workaround for Scenarios. I admit my proposal above is rather academic ...

Regards,
  angel'o'sphere