• Fregas (unregistered) in reply to Apoch
    Apoch:

    <FONT face=Verdana size=1>I'm not talking about separating logic and content - that's the first level of distinction, which ASP/PHP/etc. handles very nicely. What I'm talking about is separating logic from content and also from the way the content is generated. In my case, the client wanted a site that they could redesign on a regular basis without touching the database access and shopping cart code. I don't mean redesign like changing the fonts and colors - that's trivial with CSS - but changing the actual physical layout and structure of pages.

    Web applications are not really my forte, but I'd be shocked to learn of a technique for allowing that kind of redesign on-the-fly that didn't involve a templating system sitting on top of ASP/what have you. This was in the olden days before ASP.Net (which I have no experience with, having moved on to much better projects since then) and for the situation at the time I am not aware to this day of any approach that would have been better.

    The segments were build of simple blocks like:

    WelcomeBanner
    ProductList CurrentPromo
    ProductList MensShoes
    ShoppingCartBar
    Footer

    If it isn't blindingly obvious how that's easier for a marketroid to work with than an ASP script, I deeply envy your sheltered career and the wonderful people you work with [;)]</FONT>

    <FONT face=Verdana size=1>No wheels were reinvented in the making of this film - at least not any wheels which existed at the time.</FONT>

    Sorry I fail to see how <%= WelcomeMessage %>is so much harder than @@ WelcomeMessage @@ or its like.  But I guess I'm just not understanding the full requirements of what and how they would change.  I DO think it would be way easier to to what your describing in asp.net than ASP, because what you are talking about sounds like User Controls, JSP tags or even coldfusion tags...none of which was available in ASP/PHP as far as I know.   Basically a tag where the dumb user just specifies the name of the tag and a bunch of properties:

    <WELCOMEBANNER color="green" image="/banners/greenbnr.gif" styleclass="somestyle" message="Welcome to our site" />

    Is this kind of what you're talking about?  I guess that would go way beyond the simple variable replacement and would require some hacking to do in asp or php.  In .NET, Java or Coldfusion though it would be simple...

     

  • (cs) in reply to Fregas

    Principle of least privilege also raises its ugly head here.  Consider a content engineer who's gotten a hold of an ASP book and wants to start fooling around.  If you give him access to an ASP page full of <% = orderTotal %> etc, he might start putting FormatNumber()'s and even If / Then's in there..

    The templating system stops this because ASP directives he ads won't be processed, just dumped as raw text to the browser.

  • bp (unregistered) in reply to richleick
    richleick:
    I have to disagree to some extent that this is a wtf.  Especially from the other wtf's we have seen.  I worked for a company that implemented this same type of philosophy.
    [...] 
    But a wtf?  Not really.  (imho)


    I'd have to agree, it's a common pattern, though maybe the implementation leaves something to be desired.
  • (cs) in reply to bp

    Hmm, I did this with Perl CGI, about 7 years ago... First interactive website I did, a VERY basic CMS... I didn't know any better :)

  • Bill (unregistered)

    For fuck's sake this guy is a lunatic!

  • dtfygjkol (unregistered)

    [:$][8-|][6][*][8][8][<:o)][:^)][pi][mo][8o|][^o)][N][+o(][U][li][ip][ap][S]

    Alex Papadimoulis:

    David DeLoveh came across an ASP 3.0 developed by some programmers with decent intentions: make the site easier to maintain by separating the VBScript code from the HTML. They figured that things like <%=OrderTotal%>embedded in HTML would confuse web designers who may want to update the site. So, they developed a system that would read files from disk, process them, and write the contents out. They even came up with their own tag system that would be sure not to confuse a designer: instead of the complex <%=OrderTotal%>designers would use @@ORDERTOTAL@@.

    It worked out all well and good until people actually used the site. As it turns out, ASP isn't really designed to implement itself. It tends to slow down when reading lots of files from disk, storing the content in variables, doing multiple replacements, and writing out the content ...

    Const cstpg_SHOW_DISCOUNT = "e:\content\estore\shopping_cart\show_discount.html"
    

    Dim v_Content Dim v_OrderNumber, v_OrderFinal, v_OrderSum, v_OrderInit, v_OrderRec

    'ED: Snipped loading from databsae

    v_Content = CreateObject("Scripting.FileSystemObject").OpenTextFile (cstpg_SHOW_DISCOUNT, 1, False, False).ReadAll v_Content = Replace(v_Content, "@@ORDERFINAL@@", FormatNumber(v_OrderFinal)) v_Content = Replace(v_Content, "@@ORDERSUM@@", FormatNumber(v_OrderSum)) v_Content = Replace(v_Content, "@@ORDERINIT@@", FormatNumber(v_OrderInit)) v_Content = Replace(v_Content, "@@ORDERREC@@", FormatNumber(v_OrderRec))

    Response.Write v_Content

  • aman (unregistered) in reply to Apoch

    thanks

Leave a comment on “ASP = ASP Server Pages”

Log In or post as a guest

Replying to comment #:

« Return to Article