Map Literals to Object Properties/Values
<p>For eg, my input XML is look like this.</p>

<pre><code>&lt;root&gt;
&lt;myelemt&gt;
&lt;input type="variable"&gt;
&lt;variable&gt;STARTDATE&lt;/variable&gt;
&lt;variable&gt;CUSTOMERNAME&lt;/variable&gt;
&lt;/input&gt;
&lt;/myelemt&gt;
&lt;/root&gt;
</code></pre>

<p>it is deserialized and loaded into the object MyXmlElemtObj</p>

<p>in my code i have written like this,</p>

<pre><code> if(MyXmlElemtObj.input.variable.ToUpper() == "STARTDATE")
    ProcessObjectB(ObjectA.OrderDate);

if(MyXmlElemtObj.input.variable.ToUpper() == "CUSTOMERNAME")
    ProcessObjectB(ObjectC.UserName);
</code></pre>

<p>Here I am mapping those input literals to some objects value.</p>

<p>The one thing that scares me is seeing some ** hard-coded literals** all over my code.</p>

<p>Instead i would like to write something like <code>ProcessObjectB(Common.GetMappedvalue(MyXmlElemtObj.input.variable));</code></p>

<p>Is there a way to isolate this mapping thing to common class, where i will predefine
which literal is mapped to which values. The problem is the values are of objects created at the run time.</p>

<p><strong>If my question is making sense then So how do i achieve this?</strong></p>

<p>I think i have given all the necessary details. if anything is missing please metnion. Thx Much.</p>
