Difference between revisions of "Documentation/DevGuide/OfficeDev/Frame-Controller-Model Paradigm in OpenOffice.org"
OOoWikiBot (talk | contribs) m (FINAL VERSION FOR L10N) |
|||
Line 7: | Line 7: | ||
}} | }} | ||
{{Documentation/DevGuideLanguages|Documentation/DevGuide/OfficeDev/{{SUBPAGENAME}}}} | {{Documentation/DevGuideLanguages|Documentation/DevGuide/OfficeDev/{{SUBPAGENAME}}}} | ||
− | {{DISPLAYTITLE:Frame-Controller-Model Paradigm in | + | {{DISPLAYTITLE:Frame-Controller-Model Paradigm in {{AOo}}}} |
<!--<idltopic>com.sun.star.frame.XModel;com.sun.star.frame.XFrame;com.sun.star.frame.XController</idltopic>--> | <!--<idltopic>com.sun.star.frame.XModel;com.sun.star.frame.XFrame;com.sun.star.frame.XController</idltopic>--> | ||
− | The well-known Model-View-Controller (MVC) paradigm separates three application areas: document data (''model''), presentation (''view'') and interaction (''controller''). {{ | + | The well-known Model-View-Controller (MVC) paradigm separates three application areas: document data (''model''), presentation (''view'') and interaction (''controller''). {{AOo}} 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 {{ | + | The FCM paradigm in {{AOo}} 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 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. | ||
Line 19: | Line 19: | ||
The purpose of FCM is to have three exchangeable parts that are used with an exchangeable window system: | 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 | + | 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. | 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 {{ | + | 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 {{AOo}} 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. |
{{PDL1}} | {{PDL1}} | ||
[[Category:Documentation/Developer's Guide/Office Development]] | [[Category:Documentation/Developer's Guide/Office Development]] |
Latest revision as of 17:30, 2 January 2021
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). |