IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Ruby on Rails
Anyone have experience with [link|http://www.rubyonrails.org/show/HomePage|Ruby on Rails]? We're currently using Perl & Mason for our web applications. Certainly a capable combination, but not satisfying for the way I like to separate code & presentation. Ruby on Rails seems more in line with that.
Have fun,
Carl Forde
New Not I
However before evaluating any templating system, I'd suggest looking at the mod_perl guide, [link|http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html|Choosing a Templating System]. That article is Perl-specific, but the major templating options in Perl they manages to give a sense of the strengths and drawbacks of various basic approaches to templating. That should give you a lot of perspective on any templating system that you encounter. Either in Perl or in other languages.

Incidentally my favorite templating system in Perl is the Template::Toolkit.

Cheers,
Ben
To deny the indirect purchaser, who in this case is the ultimate purchaser, the right to seek relief from unlawful conduct, would essentially remove the word consumer from the Consumer Protection Act
- [link|http://www.techworld.com/opsys/news/index.cfm?NewsID=1246&Page=1&pagePos=20|Nebraska Supreme Court]
New Thanks for the link
I needed a good analysis of templating options to help me write some documentation for *my* templating option. :)
New Maybe we should share.
I like at the top of the writeup Ben linked to that almost everyone writes a template system at some point - generally to reflect certain specific needs at the time.

I've linked to [link|http://yceran.org/qompose/|Qompose] before; is your template system available for general perusal?

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New Not ready for perusal
I really can't show it off right now because I'm in the middle of rewriting it, having just separated it from the ORM I wrote at the same time.

..but I can describe it. And I might as well name it: "Cation". Pronounce in two or three syllables as you see fit.

The actual templating is bare bones: slurp in a template and substitute in a dictionary (aka hashmap). That's all encapsulated in a nice base class, an "Assembly", which makes that easier, but that's the basic methodology. No flow control (or any code) inside templates, just static text. If you want to repeat table rows, for example, that doesn't go in the template; it goes in the handler script. The template would just write:

<table>\n    %(TableRows)s\n</table>


The templating is really the weakest part at the moment, and I may rewrite it on a whim sometime soon. But Cation is a larger app framework. I always like to describe frameworks primarily by pointing out those places where you can easily flex them. So here are the biggies:

0. Not exclusively for web apps. The core Application framework is delivery-method agnostic. But the web app interface is the only well-developed one at this point. The Assembly class is ML-agnostic; I've used it for email bodies as well as HTML, for example.

1. Web server: Comes with an adapter for IIS/ASP, another for Apache/mod_python. Working on a third for WSGI (an emerging Python web standard). These are all 100 lines or less; new ones would be a snap for Twisted, bare CGI, Roxen, AOL, etc. If WSGI takes off, I won't have to care. ;)

2. Handles async servers which expect a callable iterator (instead of write() calls).

3. File-based vs. in-code templates: up to the developer.

4. Data Persistence: not included so grab someone else's (preferably my ORM ;)

5. Use the builtin URI-to-script mapper or roll your own (usually just means a modified regex). Or, bypass the mapper and call _dispatch directly (error page redirection does this, for example).

6. Page caching: up to the developer. Most Cation apps have a persistent module or two--if you want caching, stick a reference to the right Assembly in there.


Other things it does/is/has:

1. Logging
2. Top-level error trapping, logging, and pretty printing
3. Timed, threaded Worker classes for getting things done on a schedule, possibly recurring.
4. Handles central application configs, either from code or INI-style files.
5. Security is minimal. Only keeps a list of superusers at the moment, which is crucial for...
6. Admin web page, from which you can reload modules, get user last login times, see template constants, start/stop/modify workers.
7. Registry of startup/shutdown functions.
8. UI's (active requests) are centrally registered and managed.
9. Data type coercion (both inbound and outbound).
10. Admins can capture profile data per user per request.
11. HTTP uploads.
12. Standard subclasses of Assembly for common html elements: option, input type=checkbox, table, frameset, whole redirect pages.

What it doesn't do:
1. Sessions. Can't get the bloody things to work with ASP and I don't currently need them anyway.
2. No defined interface for remapping scripts. TODO.
3. Lots of things I can't think of right now.




The Sig:
"Despite the seemingly endless necessity for doing
so, it's actually not possible to reverse-engineer intended invariants
from staring at thousands of lines of code (not in C, and not in
Python code either)."

Tim Peters on python-dev
New In a nutshell
Thanks for the link.
The callback model can get a bit hairy when you have to code logic that can result in totally different content being returned. For example, if you have a system that processes some form input and takes the user to different pages depending on the data submitted. In these situations, it's easy to end up coding a spaghetti of includes and redirects, or putting what are really multiple pages in the same file.

This is pretty much what I've stepped into. I need to take one of our web sites apart and put it back together again for the next version. I'm trying to decide how best to do that. I think for now I'm going to stick with Perl and Mason, but I want to understand other approaches and learn what I can from them.
Have fun,
Carl Forde
New Dumb question regarding mentioned spag code
If I am designing a web object(I dont do this as a rule) and I have many links on a single page which may lead to multiple changing sources. Would it not be easier to have the page serve links to a table which then can be updated as needed as opposed to spaggetti coding links into the web page? This way you would need to modify the page unless adding something new.
thanx,
bill
These miserable swine, having nothing but illusions to live on, marshmallows for the soul in place of good meat, will now stoop to any disgusting level to prevent even those miserable morsels from vanishing into thin air. The country is being destroyed by these stupid, vicious right-wing fanatics, the spiritual brothers of the brownshirts and redstars, collectivists and authoritarians all, who would not know freedom if it bit them on the ass, who spend all their time trying to stamp, bludgeon, and eviscerate the very idea of the individual's right to his own private world. DRL
questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
New Re: question regarding mentioned spag code
I must admit that I haven't designed very many web objects either. And I'm unclear what you're really asking. Are you suggesting externalizing the links and targets in a database and generating the page with them dynamically? On the face of it, I'd say that makes sense. Or are have I misunderstood what you're asking?
Have fun,
Carl Forde
New thats what I was after, thanx
These miserable swine, having nothing but illusions to live on, marshmallows for the soul in place of good meat, will now stoop to any disgusting level to prevent even those miserable morsels from vanishing into thin air. The country is being destroyed by these stupid, vicious right-wing fanatics, the spiritual brothers of the brownshirts and redstars, collectivists and authoritarians all, who would not know freedom if it bit them on the ass, who spend all their time trying to stamp, bludgeon, and eviscerate the very idea of the individual's right to his own private world. DRL
questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
     Ruby on Rails - (cforde) - (8)
         Not I - (ben_tilly) - (7)
             Thanks for the link - (FuManChu) - (2)
                 Maybe we should share. - (static) - (1)
                     Not ready for perusal - (FuManChu)
             In a nutshell - (cforde) - (3)
                 Dumb question regarding mentioned spag code - (boxley) - (2)
                     Re: question regarding mentioned spag code - (cforde) - (1)
                         thats what I was after, thanx -NT - (boxley)

Damn! Bloody %^@&^@ anal-retentive Geo Booleishness!
97 ms