Hi all, I've been dabbling in Pylons for about a year now, bringing myself up to speed on an outstanding enabling technology that shows real depth and breadth. An experienced Python programmer, I am quite impressed. The software is mature, and implements a lot of great insight into what it takes to design - and not just hack together - a stable web application. The mental-model is sound.
I still find myself struggling, though, with certain fairly basic architectural questions when starting an application in Pylons. I was hoping that some of the more experienced Pylons crew would take a few minutes and maybe help compile some "best-practices" that will allow others get off the ground more quickly. To get things started, I'll outline a couple of questions that I'm still waffling on. If you'd like to chime in on these OR offer some of the best-practices that you've settled on, I'd really appreciate it. 1) How many Controllers? Pylons supports multiple Controllers. When should you use more than one? How many should you use? One for each of the major entities in your object mode? 2) How to treat templates? The Pylons documentation seems to suggest (to me at least) that the "right" way to use templates is to dump data - typically strings and other literals - into the template context and simply render the template. We could choose, instead, to use render_def and pass the data as explicitly named parameters to template defs. Which method do people prefer? 3) Segregation of display functions from other processing This is a more general encapsulation question suggested by the previous question. We COULD, if we wanted to, have the controller add ITSELF to the template context. The template, then, would have access to all the functionality that the Controller embodies. Alternatively, we could put just the Controller's methods into the template context. Or we could just pass in literals. Where do folks draw the line? Again, please chime in here with your own best-practices or best- practice questions. I'd love to see a productive discussion of this stuff! Cheers! ~br -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
