lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 957fb26 8/9: Favor problem-domain terminology


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 957fb26 8/9: Favor problem-domain terminology
Date: Thu, 27 Sep 2018 12:53:51 -0400 (EDT)

branch: master
commit 957fb268a0508c6242e6ffaff054ad49f4dde3c0
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Favor problem-domain terminology
    
    A question like "what's the premium load?" would immediately be
    answered with something like "three percent". A question like "what
    are the premium loads?" would more likely draw a response such as
    "two percent for premium tax, and one percent for DAC tax". Here,
    the former is wanted. It's just unfortunate that the XSL-FO original
    used the latter, yet at this moment the goal is to reproduce the old
    system's PDF output, not to improve it; but internal C++ variable
    names should be as good and consistent as possible.
    
    It is especially problematic to use a name such as "admin charges",
    which looks like a term of art but lacks any universal definition.
    It might be defined in different ways by different contracts. The
    replacement "misc charges" more clearly cannot be a universal term:
    a deliberately uninformative name is better than a misleading one;
    being forced to ask is better than being invited to assume, wrongly.
---
 ledger_evaluator.cpp        | 21 +++++++++++++--------
 ledger_pdf_generator_wx.cpp |  4 ++--
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/ledger_evaluator.cpp b/ledger_evaluator.cpp
index 4c580fe..bdee783 100644
--- a/ledger_evaluator.cpp
+++ b/ledger_evaluator.cpp
@@ -759,18 +759,23 @@ ledger_evaluator Ledger::make_evaluator() const
     LedgerVariant   const& Curr_ = GetCurrFull();
     LedgerVariant   const& Guar_ = GetGuarFull();
 
-    std::vector<double> PremiumLoads(max_duration);
-    std::vector<double> AdminCharges(max_duration);
+    std::vector<double> PremiumLoad(max_duration);
+    std::vector<double> MiscCharges(max_duration);
     for(int j = 0; j < max_duration; ++j)
         {
-        PremiumLoads[j] = Invar.GrossPmt[j] - Curr_.NetPmt[j];
-        AdminCharges[j] = Curr_.SpecAmtLoad[j] + Curr_.PolicyFee[j];
+        PremiumLoad[j] = Invar.GrossPmt[j] - Curr_.NetPmt[j];
+        MiscCharges[j] = Curr_.SpecAmtLoad[j] + Curr_.PolicyFee[j];
         }
 
-    vectors   ["PremiumLoads"] = &PremiumLoads;
-    format_map["PremiumLoads"] = f1;
-    vectors   ["AdminCharges"] = &AdminCharges;
-    format_map["AdminCharges"] = f1;
+    vectors   ["PremiumLoad"] = &PremiumLoad;
+    title_map ["PremiumLoad"] = "Premium\nLoad";
+    mask_map  ["PremiumLoad"] = "999,999,999";
+    format_map["PremiumLoad"] = f1;
+
+    vectors   ["MiscCharges"] = &MiscCharges;
+    title_map ["MiscCharges"] = "Miscellaneous\nCharges";
+    mask_map  ["MiscCharges"] = "999,999,999";
+    format_map["MiscCharges"] = f1;
 
     // ET !! Easier to write as
     //   std::vector<double> NetDeathBenefit =
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index eb4e2e3..d6d9a38 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -3033,8 +3033,8 @@ class reg_d_indiv_curr : public page_with_tabular_report
             {{ "PolicyYear"                 , "Policy\nYear"                ,  
       "999" }
             ,{ "AttainedAge"                , "End of\nYear\nAge"           ,  
       "999" }
             ,{ "GrossPmt"                   , "Premium\nOutlay"             , 
"999,999,999" }
-            ,{ "PremiumLoads"               , "Premium\nLoads"              , 
"999,999,999" }
-            ,{ "AdminCharges"               , "Admin\nCharges"              , 
"999,999,999" }
+            ,{ "PremiumLoad"                , "Premium\nLoads"              , 
"999,999,999" }
+            ,{ "MiscCharges"                , "Admin\nCharges"              , 
"999,999,999" }
             ,{ "COICharge_Current"          , "Mortality\nCharges"          , 
"999,999,999" }
             ,{ "SepAcctCharges_Current"     , "Asset\nCharges"              , 
"999,999,999" }
             ,{ "GrossIntCredited_Current"   , "Investment\nIncome"          , 
"999,999,999" }



reply via email to

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