XRCed Data Model

Data model used by XRCed is using a set of classes providing interface to the DOM objects. This allows easy manipulation of arbitrary fragments of the XRC file while caching only the editable data in the interface objects.

XRC file has the following structure:

<?xml version="1.0" ?>
<resource>
  <object class="class_name" name="XRC_id">
    <property_name>property_value</property_name>
    ...
  </object>
</resource>

Where property_name stands for property name tags such as 'label', 'orientation', etc.

After parsing XRC into DOM (using xml.dom.minidom module) one 'xxx' object is generated for each <object> element, instantiating a class derived from xxx.Object base class (in module 'xxx'). For properties there is a base class class xxx.Property and specific derived classes such as xxx.FontProperty.

Module 'components' contains classes derived from xxxObject, which provide specific interface to various interface elements. This module is populated at run-time from the installed 'xxx-plugins' by the plugin manager subsystem.

MVP design

I desided to use ModelViewPresenter paradigm for refactoring (in the limits of my grasp of this subject). The image below presents an overview of the new design.

view
collection of objects managing interface elements, and associated event handlers.
Model
global model object used to interface XML and other data files.
Presenter
global presenter object, stores additional data needed for editing, view generation and updates Model when needed.
Listener

global listener AKA interactor object. It has Install method to setup event handlers to the view objects. The events are received by Listener and propagated to Presenter or processed in-place.

Manager
can be considered a part of presenter. Stores data related to loadable components, component registration tasks. Used by view objects to generate interface for attribute panel, menus and tool panels.

XRCed_MVP.001.png

XRCed Data Model (last edited 2008-03-11 10:50:18 by localhost)

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.