class Rental...
public int getFrequentRenterPoints() {
return movie.getFrequentRenterPoints( daysRented);
}
class Movie...
public int getFrequentRenterPoints( int daysRented) {
if( getPriceCode()==NEW_RELEASE && daysRented()>1)
return 2;
else
return 1;
}
Рис 1.13 Диаграмма классов после переноса метода в класс Movie
В начало | предыдущая | следующая