public static void DemoRun() { // With this principle, we have a clean separation of concerns by splitting the behavior // of the classes as separate behavior based interfaces Automobile car = new Car(); IsRentable rentableCar = car as IsRentable; IRentalRepository rentalRepository = new ABCCompanyRentalRepository(); if (rentableCar != null) { rentalRepository.ListForRental(rentableCar); } Automobile plane = new Plane(); IsRentable rentablePlane = plane as IsRentable; if (rentablePlane != null) { rentalRepository.ListForRental(rentablePlane); } }
public void ListForRental(IsRentable auto) { }