Πέμπτη 27 Ιανουαρίου 2022

Facade pattern

  • What problem does Facade pattern solve?



Suppose a caller client needs to make a vacation booking through a vacation company, including:

- Flight
- Hotel
- Car rental 

The client should only need to send his dates to the company.

He must do himself the flight, car and hotel bookings, one-by-one.

So below code should be fixed:


  • How does Facade pattern solve this?



We simply create a VacationFacade class, that includes all actions required to book a holiday (flight, hotel and car)




And finally use it in our client part















Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου

What may be missing, or could get better?