String Handling Issue
<p>On my client-server system, a user can change a value of a <strong>Variable</strong>, say "System Power" in a drop-down box ("ON", "OFF", "STANDBY"). </p>

<p>When clicking an index, a message gets passed to the server to change the variable that captures the state of "System Power" in this case.</p>

<p>Currently, my server-side code is implemented to try to convert the value in the client's message as an Int64. </p>

<p>Here are my thoughts as to a solution:</p>

<p>1 - hard code logic in my client-side code to send the right Int64 value. Example: send message(System Power, 1) instead of message(System Power, OFF).</p>

<p>2 - from the client-side, read an XML file that maps <strong>Variable</strong>'s state (ON, OFF) to an Int64 value</p>

<p>3 - fix the server-side to behave correctly.</p>

<p>I think #1 is a poor option due to inflexibility. #3 is the right option, but it will take me too long on my schedule.</p>

<p>To implement #2, would it make sense to create an XML file like this:</p>

<pre><code>&lt;root&gt;
  &lt;Variables&gt;
    &lt;System Power&gt;
      &lt;element name="ON"&gt;1&lt;/element&gt;
      &lt;element name="OFF"&gt;0&lt;/element&gt;
...
</code></pre>

<p>Then, in my client-side code, I could perform a look-up in the XML file to determine the correct message(System Power, 0).</p>

<p>Please advise. Thank you.</p>
