flightbooking
is available only as jar file (Referenced Libraries/booking.jar
).flightbooking.Main
.
It has a simple GUI which will direct you through the relevant transactions.
Note that this variant does not include collecting bonus points.
bonussystem/Bonus
:fbappication/FlightBonus
:GUIConnector
.
It adapts the original GUI in booking.jar
.FlightbookingWithBonus.launch
.
Looking at this launch configuration you will find these relevant settings:
Enable OTRE
and Java 5 JPLIS Launching
GUIConnector
is selected for instantiation and activation.WindowPlacer
which ensures that
new windows are always centered with respect to the desktop/their parent.java.awt.Window
which is not adaptable using the old launch mode.
flightbooking.PassengerList.add()
.
fbapplication.GUIConnector.Controller
is responsible for this (it's a callin binding): queryRegisterForBonus <- after add;
Whenever a passenger is added to that list (an internal "repository"),
the user is asked, whether the passenger wants to participate in the bonus programme.
If so, a new FlightBonus
instance is created
and the passenger is implicitly registered
(cf. the implementation of fbapplication.BonusGUI.Controller.queryRegisterForBonus
).
After that all bookings for this passenger will also give bonus credits
to the passenger.
Collecting credits will be reported by a new dialog box — the nested team
.
This team defines another layer over the team FlightBonus, observing the behaviour of its roles.
fbapplication.GUIConnector.FlightBonusDialog
FlightBonus extends Bonus
and GUIConnector extends BonusGUI
.
In both cases the contained roles are further specialized in the sub-team.FlightBonusDialog
implicitly inherits all roles from its implicit super team of the same name.
The inner most roles recursively inherit from their implicit super roles.FlightBonus
and the GUIConnector
teams are both triggered
via callin bindings, by which they hook into the underlying system.
In the case of the FlightBonusDialog
the base classes are roles, too.
This means roles are used to intercept events at some other roles.fbapplication.BonusGUI.FlightBonusDialog
and
fbapplication.GUIConnector.FlightBonusDialog
.
Each role file resides in a team package
that has the same name as the enclosing team (i.e., a team is a class and a package).GUIConnector
is activated via the launch configuration
(GUIConnector
creates instances of FlightBonus
and FlightBonusDialog
, both of which invoke activate()
(FlightBonus.Subscriber
and BonusGUI.Collector
restrict
activation to specific instances using a guard predicate (FlightBonus(Passenger as Subscriber s)
uses declared lifting
(FlightBonusDialog(FlightBonus fb)
is a lifting constructor,
which means it will implicitly be used by the lifting operation, but it can also be
invoked explicitly, to create a new role for a given base instance
(cf. method queryRegisterForBonus
).