Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Nes - a new Push style templating system

by metaperl (Curate)
on Apr 15, 2010 at 19:09 UTC ( [id://834950]=note: print w/replies, xml ) Need Help??


in reply to Push style templating systems

Nes is short for "No embedded source" - yet it allows for embedding SQL (grin).


The mantra of every experienced web application developer is the same: thou shalt separate business logic from display. Ironically, almost all template engines allow violation of this separation principle, which is the very impetus for HTML template engine development.

-- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"

  • Comment on Nes - a new Push style templating system

Replies are listed 'Best First'.
Re: Nes - a new Push style templating system
by Skriptke (Acolyte) on May 01, 2010 at 11:23 UTC
    Only 'SELECT' statement. Since the template does not modify the application data.
    
        Nes Model:
    
        .----------------------------------------------.
        |                 | Nes Object |               |
        |                 '------------'               |
        | .-------------------.    .-----------------. |
        | |  template.nhtml   |    |    script.pl    | |
        | |-------------------|    |-----------------| |
        | |        _          |--->|    _       _    | |
        | |        |          |<---|    |       |    | |
        | '--------|----------'    '----|-------|----' |
        '----------|--------------------|-------|------'
                   |                    |       |
                   |                    |       '------------------.
                   |                    |                          |
                   v                    v                          v
        .----------------------.  .-----------------------.  .------------.
        |                      |  |                       |  |            |
        |  Nes Object Library  |  |  My App Perl Library  |  |    CPAN    |
        |                      |  |                       |  |            |
        '----------------------'  '-----------------------'  '------------'
    
        Nes Object:
    
        .------------------------------------------------------------------------------------.
        |                                 | Nes Object |                                     |
        |                                 '------------'                                     |
        | .-----------------------------------.    .---------------------------------------. |
        | |          template.nhtml           |    |              script.pl                | |
        | |-----------------------------------|    |---------------------------------------| |
        | |                                   |--->|                                       | |
        | |    {: Nes 1.0 ('script.pl') :}    |    | Nes::Singleton->new('template.nhtml') | |
        | |                                   |<---|                                       | |
        | '-----------------------------------'    '---------------------------------------' |
        '------------------------------------------------------------------------------------'
    
        Nes Request:
        
        .-------------------------------------------.
        |         GET or POST HTTP Request          |
        |     http://example.com/template.nhtml     |
        '-------------------------------------------'
                            |
                            v
        .-------------------------------------------.
        |        /cgi-bin/nes/dispatch.cgi          |
        '-------------------------------------------'
                            |
                            v
        .-------------------------------------------.
        |              Nes::Singleton               |
        |-------------------------------------------|
        | new {'CFG'} for this dir                  |
        | new {'top_container '} for template.nhtml |
        '-------------------------------------------'
                            |
                            v
        .-------------------------------------------.
        |     Nes::Singleton->{'top_container'}     |
        |-------------------------------------------|
        | new {'register'}                          |
        | new {'query'}                             |
        | new {'cookies'}                           |
        | new {'session'}                           |
        | new {'container'} for template.nhtml      |
        '-------------------------------------------'             
                            |
                            v
        .-------------------------------------------.
        |       Nes::Singleton->{'container'}       | <---.
        |-------------------------------------------|     |
        | get {  NES 1.0 ...  } line                |     |
        | new {'content_obj'} for this content type |     |
        '-------------------------------------------'     |          
                            |                             |
                            v                             |
        .-------------------------------------------.     |
        |             do Perl scripts               |     |
        |-------------------------------------------|     |
        | Nes::Singleton->out()                     |     |
        '-------------------------------------------'     |
                            |                             |
                            v                             |
        .-------------------------------------------.     |
        | Nes::Singleton->{'container'}->interpret  |     |
        '-------------------------------------------'     |
                            |                             |
                            v                       ( interaction )
                 .---------------------.                  |
                 | {  include  }   ?   |---{ yes }--------'
                 '---------------------'                         
                            |
                          { no }
                            |
                            v
        .-------------------------------------------.
        | print HTTP Headers                        |
        | print the out                             |
        '-------------------------------------------'  

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://834950]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2025-07-13 02:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.