<div dir="ltr"><br><br><div class="gmail_quote">On Sat, Aug 16, 2008 at 10:57 PM, cdrick <span dir="ltr">&lt;<a href="mailto:cdrick65@gmail.com" target="_blank">cdrick65@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div>Hi,<br><br>I&#39;m looking for a way to hide/show portion of code depending on if it&#39;s in development or production mode. <br>
</div></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr"><br>First idea is to wrap the code in question around a global productionMode var. But I was wondering if there is a better way. Somethink to really hide these portions of code for efficiency. I know this is not a big deal (for my project) but I&#39;m quite sure something may exist maybe at the VM level, so ...</div>
</blockquote><div><br>May be you can implement a sort of Strategy pattern (<a href="http://en.wikipedia.org/wiki/Strategy_pattern">http://en.wikipedia.org/wiki/Strategy_pattern</a>) in your classes, with XXXDevelopmentStrategy classes subclass/hook/wrap your XXXProductionStrategy classes to reuse code.<br>
<br>Can you give more details ?<br> </div></div><br>-- <br>Laurent Laffont <br>
</div>