Difference between revisions of "Documentation/DevGuide/OfficeDev/Frame-Controller-Model Paradigm in OpenOffice.org"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (dash, semicolons, & commas changed)
m (FINAL VERSION FOR L10N)
 
Line 6: Line 6:
 
|NextPage=Documentation/DevGuide/OfficeDev/Frames
 
|NextPage=Documentation/DevGuide/OfficeDev/Frames
 
}}
 
}}
{{DISPLAYTITLE:Frame-Controller-Model Paradigm in OpenOffice.org}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/OfficeDev/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Frame-Controller-Model Paradigm in OpenOffice.org}}
 
<!--<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''). {{PRODUCTNAME}} 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 from MVC. The model and controller in MVC and FCM are quite different things.
 
The well-known Model-View-Controller (MVC) paradigm separates three application areas: document data (''model''), presentation (''view'') and interaction (''controller''). {{PRODUCTNAME}} 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 from MVC. The model and controller in MVC and FCM are quite different things.

Latest revision as of 11:13, 13 May 2009



The well-known Model-View-Controller (MVC) paradigm separates three application areas: document data (model), presentation (view) and interaction (controller). OpenOffice.org 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 from MVC. The model and controller in MVC and FCM are quite different things.

The FCM paradigm in OpenOffice.org 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 in a different manner 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 OpenOffice.org 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).
Personal tools
In other languages