On Sun, Jan 31, 2010 at 7:09 AM, Haron Media <[email protected]> wrote: > > I wonder how you build your models, do they handle all the data logic? > ...snip...
> I wonder what other patterns would you guys use? > > > > Vlad > Little late chiming in here. In the past I've tried to fully utilize all the features of the model classes, and I found myself bending my requirements to fit the framework. So I've backed off from that in favor of treating models as strictly row representations. This led to my controllers being a lot more complicated, which I didn't like either. So I've recently found that bfg model traversal(i call it context traversal) fits my brain better than routes. I'm not saying that everyone should ditch pylons in favor of bfg however. Just saying that I'm finding that there's potentially another object role in the system besides a model/view/controller. I guess my line of thinking right now is.... 1 - views inject data into templates 2 - controllers receive web requests and dispatch to something that produces something else to hand off to the views 3 - models represent rows and maybe relationships 4 - context receives data from the controller decides what to do and does it. whether it be get some models, or validate form posts. So far I feel this has led to a fairly rigid pattern that makes interaction between all the pieces consistent. But I'm sure that there's some complex scenario out there that breaks everything. -- Thomas G. Willis -- 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.
