While I agree that debug output breaking JSON and XML output is an issue for
many Model-Glue applications, I'm not convinced that it's worth extending
the ModelGlue.XML API to solve this when solving this with the existing API
is fairly straightforward and does not take that much more code over the
approach presented here.

All that I see that we *really* need is a predefined controller that listens
to a special message to disable debugging. A good name for this message
would be "ModelGlue.suppressDebugging" (to match the
request.modelGlueSuppressDebugging variable that it sets).

Revised example:

<event-handler name="eventHandlerWithDisabledDebug">
<broadcasts>
<message name="ModelGlue.suppressDebugging" />
</broadcasts>
</event-handler>

Revised event type example:

*
<event-type name="hasNoDebug">
<before>
<message name="ModelGlue.suppressDebugging" />
</before>
</event-type>

I'd much prefer we be conservative with extending the XML APIs as the size
of the API affects the learning curve of Model-Glue, and it's much harder to
shrink an API than it is to expand it.
*
*
*
What do others think?
*
*
-- Dennis

On Thu, Jan 14, 2010 at 9:00 PM, Dan Wilson <[email protected]> wrote:

> I just checked in a pretty cool enhancement for Model-Glue into SVN.
>
> *Ticket:* http://trac.model-glue.com/ticket/350
> *Title:* Disable Model-Glue debug information for certain events
> Example:
>
> What if you have an event that generates JSON or XML or another structured
> format and you never ever ever want Model-Glue debugging to munge it up?
>
> Well now you can simply decorate your event-handler or event-type with
> disableDebug=true and Model-Glue debugging will vanish. In both code
> examples below, the Model Glue debugging will shut itself off for that
> request. Thus, your structured data won't be affected by Model-Glue
> debugging.
>
>
> *Examples:*
>
> * **<event-handler name="eventHandlerWithDisabledDebug"
> disableDebug="true">*
>
> *Or using Event Types:*
>
> <event-type name="hasNoDebug" disableDebug="true">
>  <before>
> </before>
> </event-type>
>
> <event-handler name="eventHandlerWithEventTypeOfDisabledDebug"
> type="hasNoDebug">
>
>
> DW
>
>
> --
> “Come to the edge, he said. They said: We are afraid. Come to the edge, he
> said. They came. He pushed them and they flew.”
>
> Guillaume Apollinaire quotes
>
-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to