A framework to support this type of application will include high-level support for common operations such as creating, opening, or saving documents. Such support will generally include a consistent set of methods to call when the user issues a command. For the purpose of this discussion, we will call the class providing the methods the Application class.
Because the logic to implement most of these commands varies with the type of document, the Application class usually delegates most commands to some sort of document object. The logic in document objects for implementing these commands varies with the type of document. However, some operations, such as displaying the title of a document, will be common to all document objects. This suggests an organization that includes:
An application-independent document interface
An abstract class that provides application-independent logic for concrete document classes
Concrete application-specific classes that implement the interface for specific types of documents
đang được dịch, vui lòng đợi..
