lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Calculation Summary columns selection


From: Evgeniy Tarassov
Subject: [lmi] Calculation Summary columns selection
Date: Mon, 6 Nov 2006 17:12:07 +0100

This is what i was going to do to implement the feature. Could you
please comment on it if you see any problem or maybe a better way to
accomplish the same thing, as i'm not sure that it is the best one
could do using the existing lmi code.

step 0) code duplication

Implement a PropertiesModel class which inherits from MvcModel. This
class would have the same 12 columns list as in Input class.
class PropertiesModel
   :public MvcModel
{
   mce_report_column CalculationSummaryColumn00;
   ...
   mce_report_column CalculationSummaryColumn11;
};

Implement the pure virtual methods of MvcModel using the same code as
in Input class (input.cpp).

Edit xml_notebook.xrc and duplicate the xml code describing columns
layout (as for Supplemental Report columns).

Write a code that reads/writes value from/to configurable_settings.

Add set_XXX methods to configurable_settings (or derive from
configurable_settings and make settings editable through the derived
class).

Add a method to write the changes in configurable_settings back into
configurable_settings.xml file.

step 1) code refactoring

Add a common base class for the PropertiesModel and Input. Which would
contain the implementation of the pure virtual methods from MvcModel
class and would implement it through the MemberSymbolTable class
methods.

Implement a base type for Input::SupplementalReportColumnXX and
PropertiesModel::CalculationSummaryColumnXX that will read its domain
values from format.xml file. The existing type is mce_report_column
which has its values hardcoded in mc_enum_types.xpp.

step 2) code changes

I will try to change Mvc code to support complex data types such as
ordered vectors, to avoid using magic numbers like 12 for column
number.

----

Do you think that this mini-roadmap is good?
The step 0 is really the minimal thing to do to implement the
requested feature but basicly its a copy/paste from the existing code.
Step 1 is about code refactoring, but still the magic list of 12
columns is far from ideal. And the step 3 is the most difficult as it
involves modifications in the existing Mvc code as far as i could
understand the code.

Thank you in advance!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]