FreeMind refactoring plan: Difference between revisions
From FreeMind
Jump to navigationJump to search
No edit summary |
Dan Polansky (talk | contribs) (+cat) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
I propose following refactoring steps in order to improve FreeMind's architecture and design: see [http://freeplane.wiki.sourceforge.net/refactoring freeplane refactoring page]. --[[User:DimitriPolivaev|DimitriPolivaev]] | |||
{| {{Table style}} | |||
|+ Original proposal of refactoring | |||
! Keywords | |||
! Problem | |||
! Measure | |||
|- | |- | ||
| Property packages | | Property packages | ||
| Over sized Model and controller classes, different features are implemented in these kernel classes instead of their own separate and | | Over sized Model and controller classes, different features are implemented in these kernel classes instead of their own separate and lose coupled classes. | ||
| Split model and controller in multiple classes responsible for different node and map properties (node text, edges, clouds, icons etc). Put thess classes in different packages. Provide facade classes for the packages. The classes containing the actions should be specified in mindmap_menus.xml. | | Split model and controller in multiple classes responsible for different node and map properties (node text, edges, clouds, icons etc). Put thess classes in different packages. Provide facade classes for the packages. The classes containing the actions should be specified in mindmap_menus.xml. | ||
Different packages should be introduced for: | |||
* node formatting | |||
* text formatting | |||
* clouds | |||
* edges | |||
* icons | |||
* attributes | |||
and so on. | |||
|- | |- | ||
Line 42: | Line 51: | ||
|- | |- | ||
| | | Map loading and saving. | ||
| FreeMind specific code introduced directly into XML parser XMLElement. Mixing of XML parsing logic with freemind logic makes code difficult to understand. | | FreeMind specific code introduced directly into XML parser XMLElement. Mixing of XML parsing logic with freemind logic makes code difficult to understand. Loading and saving of map and node properties should be implemented in property packages, not at the central place. | ||
| New class NodeXmlElement extending XMLElement should contain freemind specific issues. | | New class NodeXmlElement extending XMLElement should contain freemind specific issues. .load(XMLElement e) methods symmetric to existing .save(XMLElement) methods should be created. | ||
|- | |||
| Models overloaded by loading and saving code. | |||
| Saving and Loading code belongs to model classes instead of controller classes. This leads to different model classes for browse and mind map editing modes. | |||
| All .load and .save methods should be moved from model to controller classes. So the model classes of browse mode and of mind map editing mode become identical, there are only differences between controllers. | |||
|} | |} | ||
[[Category:Development]] |
Latest revision as of 19:03, 24 September 2009
I propose following refactoring steps in order to improve FreeMind's architecture and design: see freeplane refactoring page. --DimitriPolivaev
Keywords | Problem | Measure |
---|---|---|
Property packages | Over sized Model and controller classes, different features are implemented in these kernel classes instead of their own separate and lose coupled classes. | Split model and controller in multiple classes responsible for different node and map properties (node text, edges, clouds, icons etc). Put thess classes in different packages. Provide facade classes for the packages. The classes containing the actions should be specified in mindmap_menus.xml.
Different packages should be introduced for:
and so on. |
Menu builder | Lack of menu building component. The job is done by different controller classes which makes the menu difficult to extend. | Introducing of menu builder (Design Pattern “Builder”) which can be accessed from all interested components during their initialization. |
Undo handling | Using jibx for XML serialisation of actions requires extending of the one xml document “freemind.xsd” for generation of marshallers and unmarshallers. Plug-ins can not add their own properties to maps and nodes without extending this file if they want to define their own actions.
Separation of action beans generated from this file from action code makes the code difficult to maintain and to understand. |
Use of XStream library instead of jibx for XML – Serialisation.
|
Application classes | Application initialization and building of application frame including tabbed panewith the map tabs, , scroll pane, split pane and so one is implemented in one class FreeMind which also extends JFrame. | Move application initialization logic and tab management into new classes. |
OSGI | Very complex extension mechanism (Hooks) with long class inheritance hierarchies. | Use extension objects pattern for model and controller. When model and controller should not depend on the property packages. Replace current Hooks by OSGI plug-ins directly extending controller and model classes via Extension Object pattern. |
Preferences pane builder | Almost elements of preference dialog set up in a single place. | Introducing of property editor builder (Design Pattern “Builder”). The same bilder can also be used for building formatting dialogs. |
Map loading and saving. | FreeMind specific code introduced directly into XML parser XMLElement. Mixing of XML parsing logic with freemind logic makes code difficult to understand. Loading and saving of map and node properties should be implemented in property packages, not at the central place. | New class NodeXmlElement extending XMLElement should contain freemind specific issues. .load(XMLElement e) methods symmetric to existing .save(XMLElement) methods should be created. |
Models overloaded by loading and saving code. | Saving and Loading code belongs to model classes instead of controller classes. This leads to different model classes for browse and mind map editing modes. | All .load and .save methods should be moved from model to controller classes. So the model classes of browse mode and of mind map editing mode become identical, there are only differences between controllers. |