tags:

views:

54

answers:

3

Let's say I'm making an Use Case for a game that has a scoring system. Each action you do in the game will increase/decrease your score in the game.

Here is a sketch of my Use Case:

1. ...
2. ...
...
8. The Player makes (some move).
9. The System registers the play and calculates his new score.

There is some algorithm behind calculating this new score. Should I state it in this Use Case? Should I state it in another Use Case? Should I simply omit the details of implementation of the algorithm?

Is the Use Case the correct place to state those kinds of things? Or should the Use Case just be concerned with the interactions between the Player and the System(the Game)?

I'd say I'd probably want to write down those details somewhere (if not just to make sure I really do understand them). So it looks to me maybe the best option is to make another Use Case where I describe how they work?

How are generally these kind of things done with Use Cases? Thanks

+2  A: 

Algorithms don't belong in use cases. Extract them to a business rules section or document.

Johann Strydom
+4  A: 

Algorithms are not interaction between user and system to create something of value.

They're a footnote or an appendix to the use case.

They're often important, but they're not interaction. Hence putting them in an appendix.


Also. All use cases are initiated by the Actor. They actor wants to play they game; they initiate things. The system generally can't initiate action -- it's passive, responding to the actor.

S.Lott
Another question. When the game starts the current score is set to zero. Should I define an operation that states that or not? From what I've understood from your answer, I'd say no.
devoured elysium
I can argue it both ways. I don't see any harm in saying "The System starts a new game with score set to 0"
Johann Strydom
Also, does it make any sense to start a Use Case with the System sending the first message?
devoured elysium
Actors initiate use cases. Period. The Actor starts the game. The game responds to the Actor
S.Lott
If a system ever called me up and asked me to play, I'd change my medication!
S.Lott
+1  A: 

I suggest you to use Activity Diagram to represent algorithms and leave your Use Case steps simple in this case. I also agree with "Johann Strydom" in his position.

Leo

Leonardo