 <p>I would also propose <strong>Solution 4</strong>: write a code generation tool. </p> <p>Pros:</p> <ul> <li>result is a clean debuggable code;</li> <li>unlimited configurability to your needs (if you have time of course);</li> <li>long-term investment to a dev's toolset.</li> </ul> <p>Cons:</p> <ul> <li>takes some time, esp. at start, not always sutable for write-once code;</li> <li>complicates build process a bit.</li> </ul>