8.4. Operations Interface
The com.samscdrental.controller package implements the CD rental system's operational interface via the following classes:
MaintenanceOperations.java
RentalOperations.java
ReportOperations.java
Tim and I added three operation classes to the model: RentalOperations, MaintenanceOperations, and ReportOperations. The methods in these classes represent the operations that can be requested by either the GUI or a test program. The class names use the term Operations rather than Command or Controller, since those terms have more existing connotations (e.g., the Command pattern and the Model-View-Controller pattern).
These operation classes are façades on the system's entire inner structure. They make a clean breaking point between the display and the model (see "Separating Concerns Makes Smaller Concerns"). Each operation on the user interface is represented in one of these façades. Each façade corresponds to different sets of user interactions that represent different types of users.
The RentalOperations class contains operations related to rentals: checkinCDDisc( ) and checkoutCDDisc( ). MaintenanceOperations contains the operations related to reading data from files into the collections. ReportOperations deals with report creation.
The methods in these façades declare their parameters as abstract data types (ADTs). This requires the GUI to convert an input string to the corresponding ADT before passing it to a method. Each ADT has a method that converts ...