Created
December 9, 2018 19:13
-
-
Save jainnancy/ce2743c55fc39292d359ec7220b170c0 to your computer and use it in GitHub Desktop.
TourAndTravelFacade class for facade design pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package facade | |
import subsystems.{ShuttleBooking, GuideBooking, HotelBooking, TicketBooking} | |
class TourAndTravelFacade | |
{ | |
val ticketBooking = new TicketBooking | |
val hotelBooking = new HotelBooking | |
val cabBooking = new ShuttleBooking | |
val guideBooking = new GuideBooking | |
def bookHolidayPackage(tourPackage : String, destination : String, departure : String) : Boolean = | |
{ | |
ticketBooking.bookFlight(tourPackage, destination, departure) | |
hotelBooking.bookHotel(tourPackage, destination) | |
cabBooking.bookShuttle(tourPackage) | |
guideBooking.bookGuide(destination) | |
true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment