8.4. Operations Interface

 <  Day Day Up  >  

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 from a string and indicates whether the string is formatted properly. It is the GUI's job to call this method and report to the user if the format is incorrect.

 <  Day Day Up  >  


Prefactoring
Prefactoring: Extreme Abstraction, Extreme Separation, Extreme Readability
ISBN: 0596008740
EAN: 2147483647
Year: 2005
Pages: 175
Authors: Ken Pugh

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net