> I have some question regarding the tutorial 3 and sequence diagram: > 1 how to draw the invocation of a static method. > e.g., I have the static method RollDice in the Die class. > and each player just call the static method will get the value. > also do we need to add an association for Player and Die classes for this > the static method > invocation? > The sequence diagram shows passing of control (e.g. A calls M() on B, B has the control during execution of M()). Using this definition, static method doesnt involve passing of control (at least not between objects). So, drawing a self-invocation is usually the notation. > how to draw the local variable invocation. e.g. The MGame call > player.OneTurn(die1, die2) > and the player call die1.roll() and die2.roll(), then how to draw the > sequence diagram and > class diagram? > If you mean the links between them, then Sequence Diagram _cant_ show links (this is exactly why we need the collaboration diagram). local variable reference, e.g. void m() { A objA; // this one } would NOT show up in class diagram. Class diagram records permanent (or long term) reference. So, class B { A objA; //this would shows up //other methods.... } You can point out the lacking in sequence diagram, which leads to the advantage of collaboration diagram. > 2 in class diagram, I think it is better to add a constraint that the two > dice are same > for all the players. otherwise, the system end up with a lot of dice. This is not needed. Note that using the "official solution" :), the MGame connects to the two dices, as MGame has exactly one instance (it should be a singleton), there is only two dices during runtime. Note that if the students link the Player with Dice in domain model, then this would be a valid problem (each player has two dices, so 4 players may have 8 dices etc). This is actually a good counter-example as why we shouldnt link player with dice in the first place, as the dices are shared. > 3 can you tell me what is the difference that the role name in the sequence > diagram with the box (e.g. Restaurant) and without the box (BookSystem)? > No difference. Just different notation :). Encourage them to add the box though, easier to read.