private MovieDTO getMovie(Long id) { if (movie == null || !movie.getId().equals(id)) { movie = movieService.getMovieById(id); } return movie; }
public void visitMovies(MovieVisitor visitor) { for (MovieDTO m : movieService.getAllMovies()) { visitor.visit( m.getId(), m.getTitle(), m.getReleaseDate(), m.isRented(), m.getPriceCategory()); } }