[squeak-dev] How to really make portion of code optional

laurent laffont laurent.laffont at gmail.com
Sun Aug 17 09:51:19 UTC 2008


On Sat, Aug 16, 2008 at 10:57 PM, cdrick <cdrick65 at gmail.com> wrote:

> Hi,
>
> I'm looking for a way to hide/show portion of code depending on if it's in
> development or production mode.
>

> 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'm quite sure something may exist maybe at the VM level, so
> ...
>

May be you can implement a sort of Strategy pattern (
http://en.wikipedia.org/wiki/Strategy_pattern) in your classes, with
XXXDevelopmentStrategy classes subclass/hook/wrap your XXXProductionStrategy
classes to reuse code.

Can you give more details ?

-- 
Laurent Laffont
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080817/19ccaeeb/attachment.htm


More information about the Squeak-dev mailing list