Interaction Frames
Sequence Diagrams: Interaction Frames
Ferd van Odenhoven
Fontys Hogeschool voor Techniek en Logistiek
May 27, 2015
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 1/19
Sequence Diagrams: Interaction Frames Ferd van Odenhoven Fontys - - PowerPoint PPT Presentation
Interaction Frames Sequence Diagrams: Interaction Frames Ferd van Odenhoven Fontys Hogeschool voor Techniek en Logistiek May 27, 2015 FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 1/19 Library Example Interaction Frames
Interaction Frames
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 1/19
Interaction Frames Library Example Train planner example
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 2/19
Interaction Frames Library Example Train planner example
:Restaurant
7 getNextOrderNumber() makeNewOrder("Pepperoni",1) addMeal("Pepperoni",1) new Order(7)
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 3/19
Interaction Frames Library Example Train planner example
package restaurant; public class Restaurant { public void makeNewOrder (String mealName , int nrOfPortions ) { int nr = this. etNextOrderNumber (); Order o = new Order(nr);
} private int getNextOrderNumber () { return 7; } } class Order { private int
private Set <String > meals; Order(int
this.nr = orderNr; meals = new HashSet < >(); } void addMeal(String mealName) { this.meals.add(mealName ); } }
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 4/19
Interaction Frames Library Example Train planner example
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 5/19
Interaction Frames Library Example Train planner example
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 6/19
Interaction Frames Library Example Train planner example
library Book ~getAuthor():String ~getTitle():String ~hasAvailableCOpies:boolean Library +getAvailableTitlesOfAuthor(name):String[*] * books
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 7/19
Interaction Frames Library Example Train planner example
alt: [available==true] titles:String[*] loop: [for book in books] book:Book :Library alt: [author==name] available hasAvailableCopies() add(title) title getTitle() new titles author getAuthor() getAvailableTitlesOfAuthor(name)
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 8/19
Interaction Frames Library Example Train planner example
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 9/19
Interaction Frames Library Example Train planner example
«create» 2..* {ordered} * 1 1 TrainTrip stationFrom:String stationT
addStation(station:Station Network +findConnection(s1:Station, s2:Station):Station[*] +getTrainLineIdBetween(s1:Station, s2:Station):int ~ findTrainLine(station, nextStation) * InterchangeStation lineCodes:String[*] StartStation departureTime IntermediateStation arrivalTime departureTime EndStation arrivalTime 2..* {ordered} {abstract} Station name:String isInterchangeStation:boolean TrainLine lineCode:String findLineStationsBetween(station,nextStation):Station[*] TrainPlanner createTrainTripFromT
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 10/19
Interaction Frames Library Example Train planner example
Train Trip Planner Traveller UC1 Create Train Trip UC2 Search Connection «follows»
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 11/19
Interaction Frames Library Example Train planner example
findConnection("Venlo","Moers"):InterchangeStation[*] new TrainTrip() addStation(station) createTrainTrip("Venlo","Moers") loop :TrainPlanner :Network stations :TrainTrip
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 12/19
Interaction Frames Library Example Train planner example
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 13/19
Interaction Frames Library Example Train planner example
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 14/19
Interaction Frames Library Example Train planner example
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 15/19
Interaction Frames Library Example Train planner example
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 16/19
Interaction Frames Library Example Train planner example
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 17/19
Interaction Frames Library Example Train planner example
addStation(endStation) addStation(startStation) stations:Station[*] findTrainLine(station, nextStation) :TrainPlanner createTrainTrip("Venlo","Moers") new :Network line:TrainLine stations findConnection("Venlo","Moers") :InterchangeStation[*] lineStations findLineStationsBetween(station,nextStation):LineStation[*] :TrainTrip addStation(station) loop [for each station in lineStations] loop [for station in stations] line addStation(station)
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 18/19
Interaction Frames Library Example Train planner example
FvO/FHTBM Sequence Diagrams: Interaction Frames May 27, 2015 19/19