xml-xsp-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sergeant <m...@sergeant.org>
Subject Avoiding "language impedance" in XSP (was Re: [RT] Rationalizing XSP (was: XSP and aspects))
Date Mon, 05 Mar 2001 10:26:22 GMT
On Fri, 2 Mar 2001, Ricardo Rocha wrote:

> 4) Avoiding "language impedance" in XSP
> This is a tough one: server pages developers seem to love the ability to
> embed "raw" source code in markup, a trend originally set by M$'s ASP
> and later embraced by JSP and XSP.
> While this has the appeal of enabling quick prototyping, we have come
> to suspect that _any_ language-specific programming constructs in XSP
> break encapsulation and are, therefore, WRONG!
> Embedding code in markup not only breaks encapsulation: it hinders
> reuse!

I think you're wrong here. Way off base. While I understand you're talking
about this from a theoretical standpoint, you cannot ignore the practical
issues. People can cope with <foo:do_something_major/>, but they don't
like doing <xsp:if> or whatever the equivalent would be. There's just so
much that a programming language can do, and a taglib can't. Side effects
being the one major thing that springs to mind.

In short, I think you're focussing on it incorrectly:

  The re-usable component is the generated XML - not tiny parts of the
  XSP page that you might be writing to build that XML. And putting
  code in XSP doesn't kill that notion in any way shape or form.

Taglibs are great, but they are never going to be trivial to implement,
and that is *A GOOD THING*. Its like the difference between classes and
code that uses those classes. Writing the classes is harder than writing
the code that uses the classes, and so it should be done with a clear
design and requirements document. Writing the code that uses those classes
needn't be that way.

> This whole point seems to boil down to the following:
>   All that can be achieved by embedding code in markup can also be
>   achieved by inlining the invocation of a suitably defined method
>   on a suitably defined object.

Just because you can, doesn't mean that you should.


    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
    //  \\

View raw message