> Using HTML::Mason or whatever is at least conceivable, but really when it
comes down to the difficulty of writing code in > XSP my simple answer is:
Don't do that.

> I look at XSP as an implementation of the high-level "business logic" or
"page flow" associated with your site. The core  > libraries do all the
heavy lifting and have little knowledge of XML or even Web, and the XSL
files of course have         > presentation and content.

> Here's an example XSP file from some of my own code:

> <?xml version="1.0"?>
> <xsp:page
>     xmlns:xsp="http://www.apache.org/1999/XSP/Core";
>     xmlns:f="res:perl/VR/Kernel/FirstTime"
>     xmlns:p="res:perl/VR/Kernel/Package"
>     language="perl"
>
> <response>
>     <f:bootstrap-database/>
>    <!--
>        We install the kernel's package.xml file now because it has
>        to run during the request's cleanup process. So we need to get
>        everything prepared in time for the actual parameter reading.
>    -->
>    <p:save-temp-package-from-temp-file install-from-kernel="1"/>
</response> </xsp:page>

> This file generates not one, but two databases on two different servers,
then bootstraps a few core tables into those     > databases, then loads up
an XML-based package description file into the database.

> How does it do all this? Who cares! There could be 200 or more lines of
code hidden in those calls, with complicated logic > and whatnot. This is
the beauty of XSP and taglibs: The taglibs do all the freaky complex stuff,
with no knowledge that   > they're in a web environment, and the XSP files
just describe what an individual page should do.

Hmm.  By "high level", I take it you mean abstraction.  Object oriented
programming seems to serve this purpose well.  Why not just something
similar to

my $Database = Datatbase->new();

$Database->bootstrap();
$Database->save-temp-package-from-temp-file();

This also goes for your form submission example


> If you find your XSP files getting complex, and particularly if you find
yourself wanting to use loops or variables in your XSP file, I suggest
you're   > going in the wrong direction. XML in general doesn't work very
well as a procedural language, so if you're not using it in a declarative or
functional   > way, you're asking for trouble.

Agreed.

> I have found that for most uses, XSP does the job well. It's very limited,
though, particularly if you don't use loops or variables (or any other
literal > Perl, really), and I'm looking at ways to improve that aspect of
it.

Then what is the compelling reason for using it.  If CGI/mod_perl/objects
are satisfactory...  I was also trying to think of a type of MVC approach.
There seems to be many levels of MVC ness these days, so here is an example
of what I am referring to.  Say I have a tag lib similar to the following
<log_page sub_system_name="messaging" page_id="1234" timestamp="blah blah"
/>  (insert your own parameters).  There are 250 xsp pages on my site with
this call and differing parameters.  Ok, say the interface changes.  I have
to go into 250 xsp pages and change the call.  Now let me take a non XSP
approach.  I create a "controller" for each of the sub_systems in my site.
In it I have "common services" to each subsystem.  The "common services" are
run and then delegation to the proper component ensues.  Now if I have 10
sub_systems on my site, I only have to change the call in 10 places.  I
guess you could do this with an XSP page?!  But, it seems more logical to me
to use perl code.  With XSP I feel I am working around it.  With perl I feel
its working around me.  

> I don't understand why debugging is difficult. If your Perl code has a bug
in it, you get a "die" or something, and a big error message on your screen.
> That's no different than any other templating system.

>> - Probably slower than one of the perl based methods.  (More text to
>> process eq slower?!)

> Actually, it's probably faster. XSP-based systems create a DOM tree
directly, which the LibXSLT transforms directly. If you had Embperl (for
> example) generating XML, that XML would have to be parsed before it could
be transformed.

I have not yet looked into the low level details related to caching yet.
Doesn't AxKit create the DOM tree directly after I pass it XML from say
Embperl?  If it doesn't I'm sure I could add it ;-)

JF


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to