aCiotola / ReservationSys

Software Dev 3 - Assignment
0 stars 0 forks source link

Part II – Revisit the Factory interface and implementation (minor code changes) #16

Closed aCiotola closed 7 years ago

aCiotola commented 7 years ago

In order to further decouple the system from the concrete implementations that are specific to the Dawson Hotel, we will update our abstract factory.

Edit your dw317.hotel.businss.interfaces.HotelFactory and add the following method

//ADDED IN PHASE IV
AllocationPolicy getAllocationPolicy(ReservationDAO reservations);

Note that adding methods to interfaces will break your old DawsonHotelFactory class. Add to the DawsonHotelFactory:

@Override
public AllocationPolicy getAllocationPolicy(ReservationDAO reservations){
    return new DawsonHotelAllocationPolicy(reservations);
}
aCiotola commented 7 years ago

Added code