You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xsp-dev@xml.apache.org by Matt Sergeant <ma...@sergeant.org> on 2001/03/05 11:26:22 UTC

Avoiding "language impedance" in XSP (was Re: [RT] Rationalizing XSP (was: XSP and aspects))

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.

-- 
<Matt/>

    /||    ** 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  **
     \\//
     //\\
    //  \\


Re: Avoiding "language impedance" in XSP (was Re: [RT] Rationalizing XSP (was: XSP and aspects))

Posted by Matt Sergeant <ma...@sergeant.org>.
On Mon, 5 Mar 2001, Allan Erskine wrote:

> > 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.
>
> On my first reading of Ricardo's email, I thought his focus was bang on.
> <xsp:if> is exactly the sort of direct programming construct that we DON'T
> want to need to use.  You rightly say that programming languages can do a
> lot...however so can taglibs, and they have the potential to be exactly
> aligned to multiple dimensions of the entire XML serving domain in ways no
> (current) general purpose language could (not even Perl).  So IMO it comes
> down to much more than just reuse.

What about side effects?

-- 
<Matt/>

    /||    ** 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  **
     \\//
     //\\
    //  \\


Re: Avoiding "language impedance" in XSP (was Re: [RT] Rationalizing XSP (was: XSP and aspects))

Posted by Allan Erskine <a....@cs.ucl.ac.uk>.
> > 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.

OK this seems to be a fairly large difference of opinion, but I don't think
it's irreconsilable.  First can I point out that our suggested solution to
"language impedance" within XSP could be made entirely optional on the
developers part...although I'd prefer direct language access to become
disabled by default (with a mechanism to explicitly enable it).

> 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.

On my first reading of Ricardo's email, I thought his focus was bang on.
<xsp:if> is exactly the sort of direct programming construct that we DON'T
want to need to use.  You rightly say that programming languages can do a
lot...however so can taglibs, and they have the potential to be exactly
aligned to multiple dimensions of the entire XML serving domain in ways no
(current) general purpose language could (not even Perl).  So IMO it comes
down to much more than just reuse.

----- Original Message -----
From: "Matt Sergeant" <ma...@sergeant.org>
To: "Ricardo Rocha" <ri...@apache.org>
Cc: "XSPDev" <xs...@xml.apache.org>
Sent: Monday, March 05, 2001 10:26 AM
Subject: Avoiding "language impedance" in XSP (was Re: [RT] Rationalizing
XSP (was: XSP and aspects))


> 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.
>
> --
> <Matt/>
>
>     /||    ** 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  **
>      \\//
>      //\\
>     //  \\
>