2009年3月3日星期二

[fw-mvc] Strategy for MVC modularization

Folks,
Since I am undertaking my first true "MVC" application and using this framework, I have a practical question about app structure.
 
With databases, there are normalization rules for when to break a table into two, or how many tables are needed to store a set of data if you are following certain normal forms.
 
When it comes to an MVC app, are there similar types of rules on breaking things into controllers (like a "normalization" process for MVC)? Obviously a simple app would have one controller and many actions. But if I have a more complex app, I could certainly try to still have one controller with a ton of actions, but that probably has a number of drawbacks. The way I see it, is controllers are groupings of related actions.
 
I understand MVC architecture, at least conceptually. But I'm not aware of whether there are any rules of thumb or best practices around when to group a subset of actions into a separate controller from the rest. The problem is, I can look at sample ZF apps for the next year, but they are all simple examples that only require simple app structure, and I'm looking for guidance on a more complicated app. There don't appear to be any sample apps or guidelines that I can find anywhere that addresses this topic.
 
I guess I could even ask the same thing about "modules" too.
 

Seth

没有评论: