Author Topic: Scenarios as instances of use cases  (Read 2613 times)

NothanUmber

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Scenarios as instances of use cases
« 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?
« Last Edit: March 01, 2004, 10:49:52 am by NothanUmber »

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Scenarios as instances of use cases
« Reply #1 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>>.
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

angel-o-sphere

  • EA User
  • **
  • Posts: 112
  • Karma: +0/-0
    • View Profile
Re: Scenarios as instances of use cases
« Reply #2 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