Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Nes - a new Push style templating system

by metaperl (Curate)
on Apr 15, 2010 at 19:09 UTC ( #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
Node Status?
node history
Node Type: note [id://834950]
help
Chatterbox?
[1nickt]: ping from pm-cb-g
[choroba]: pong from the same

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (15)
As of 2017-10-18 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (244 votes). Check out past polls.

    Notices?