At 12:36 PM 10/31/01 -0800, Tim Roberts wrote: >Even though I've actually implemented a small WebWare site, I'm still >trying to >grasp the 10,000 foot view of all the tools. I have a specific question >about >PSP. > >Am I correct in thinking that PSP is, essentially, just syntactic >sugar? As I >read the doc, it looks to me like a PSP-based page is fed into a translator >that produces a Python module -- a temporary servlet -- which is then passed >into the Python interpreter to be executed. Is that the model?
Yes, but the Python module is cached in the Cache/PSP directory. So it doesn't have to be re-translated unless it changes. What this means in practice is that it takes a little longer to display the PSP page the first time it's requested, but after that it's as fast as any servlet would be. >How many server invocations am I paying for in that scenario? Is the PSP >translator persistent? The big benefit of ASP, at least, is that the >interpreter lives in the server, so there is little penalty. Is the same >true >here, or do I get one invocation to translate, and another to interpret the >results? It's just as fast as a servlet after the first access. >For those of you that use PSP: do you find that the syntax is actually easier >to maintain than a straight Python scripts with HTML in """quoted strings"""? I personally prefer PSP if the page is mostly HTML with just a few Python expressions and control structures. If it's mostly Python logic with very little HTML, then use a servlet. But actually, I usually break up the logic into a Python servlet base class, and put the HTML presentation into a PSP that inherits from that base class. Then you get the best of both worlds. You get more benefits from PSP if you're using an editor that's designed to show mixed code and HTML nicely. I use SciTE. http://www.scintilla.org/SciTE.html -- - Geoff Talvola [EMAIL PROTECTED] _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
