Frame-Controller-Model Paradigm in Apache OpenOffice
- Frame-Controller-Model Paradigm in OpenOffice.org
- Dispatch Framework
The well-known Model-View-Controller (MVC) paradigm separates three application areas: document data (model), presentation (view) and interaction (controller). Apache OpenOffice has a similar abstraction, called the Frame-Controller-Model (FCM) paradigm. The FCM paradigm shares certain aspects with MVC, but it has different purposes; therefore, it is best to approach FCM independently of MVC. The model and controller in MVC and FCM are quite different things.
The FCM paradigm in Apache OpenOffice separates three application areas: document object (model), screen interaction with the model (controller) and controller-window linkage (frame).
- The model holds the document data and has methods to change these data without using a controller object. Text, drawings, and spreadsheet cells are accessed directly at the model.
- The controller has knowledge about the current view status of the document and manipulates the screen presentation of the document, but not the document data. It observes changes made to the model, and can be duplicated to have multiple controllers for the same model.
- The frame contains the controller for a model and knows the windows that are used with it, but does not have window functionality.
The purpose of FCM is to have three exchangeable parts that are used with an exchangeable window system:
It is possible to write a new controller that presents an existing model differently without changing the model or the frame. A controller depends on the model it presents; therefore, a new controller for a new model can be written.
Developers can introduce new models for new document types without taking care of the frame and underlying window management system. However, since there is no default controller, it is necessary to write a suitable controller also.
By keeping all window-related functionality separate from the frame, it is possible to use one single frame implementation for every possible window in the entire Apache OpenOffice application. Thus, the presentation of all visible components is customized by exchanging the frame implementation. At runtime you can access a frame and replace the controller, together with the model it controls, by a different controller instance.
|Content on this page is licensed under the Public Documentation License (PDL).|