Skip to content

Instantly share code, notes, and snippets.

@jainnancy
Created December 9, 2018 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jainnancy/ce2743c55fc39292d359ec7220b170c0 to your computer and use it in GitHub Desktop.
Save jainnancy/ce2743c55fc39292d359ec7220b170c0 to your computer and use it in GitHub Desktop.
TourAndTravelFacade class for facade design pattern
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