MACROMEDIA COLDFUSION 5 - CFML Manual de usuario Pagina 2

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 11
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 1
Why Use a Step Debugger?
What advantages does a debugger oer over CFOUTPUT and CFDUMP, and other
such techniques? Here are just a few ways in which interactive step debugging can
solve problems a CFML developer might otherwise nd very dicult.
You can’t always use CFOUTPUT or CFDUMP
CFDUMP and CFOUTPUT create no output when OUTPUT=”no” has been set in
CFCOMPONENT or CFFUNCTION, or when CFSILENT has been used, which you may
nd used in frameworks and complex applications. In both cases, you may try to
disable those features but that may introduce errors or unexpected results due to
other code that was relying on them, so that isn’t always an option. You could also
use CFTRACE or CFLOG to send output to a le, but this is nowhere near as simple as
viewing variables in the debugger.
Sometimes you are outputting to Flex, Ajax or Web Services — not a
browser.
You can’t always reasonably add debugging output to code that is called by a Flex or
Ajax client, or a web service. CFDUMP typically creates a big HTML table, an issue if
the client is expecting XML. The CFML debuggers, however, can debug CFML pages
requested from Flex, Flash, Flash Remoting, Ajax or web services clients. In fact, they
can intercept any kind of requests for a CFML page including scheduled tasks, event
gateways, the new CFTHREAD, or events in Application.cfc like onSessionEnd or
onApplicationEnd.
You can intercept and debug a request from any user — on remote
machines or in production!
The CFML debuggers can intercept and show the step-by-step execution of any CFML
page run by anyone in any manner. It’s not limited to requests you trigger yourself.
You can use it to debug someone elses request. This allows debugging of strange
problems on production or test servers that you can’t recreate in development. A real
end user can run a request that’s causing a problem while you watch. Of course, this
capacity is a two-edged sword. You can’t currently limit debugging to be shown only
for requests from some given user, so it will impact anyone who makes the request
while you have debugging enabled. But the CF8 debugger only intercepts the rst
request received. Another person can request the same page while the other is being
debugged and that request will not be debugged. The debugged user meanwhile
would see the page hang until the developer responded to let the page proceed.
There are performance and security impacts in enabling debugging, so you should
think carefully about leaving it enabled all the time in production.
There’s no need to change your code.
If you use CFOUTPUT and CFDUMP, you have to remember to remove those tags when
you are done debugging. How often do we see code still showing debug output?
which is very easy to learn—to use the CF8 Debugger. You can just use the Eclipse-based
debugger to do debugging and then go back to your favorite editor if you really prefer.
88 Tools The Fusion Authority Quarterly Update
Vista de pagina 1
1 2 3 4 5 6 7 ... 10 11

Comentarios a estos manuales

Sin comentarios