noodle22
Programmer
- May 8, 2008
- 23
I have two questions about MS MVC for asp.net
1) When linking or submitting a form to a controller, are query strings like MyAction?VarA=4&VarB=5... ok or should I switch to something like MyAction/4/5/. Does it really matter? I prefer to avoid creating all these special routes when I can
2)How do should one split up controllers and what they handle? Suppose I have 2 entities (or domain objects) that are related and am displaying them together in many views (however, a small number of actions for insertion and obtaining specific details occur in views where only one of the entity types is involved). Should I
a) use one controller and handle all actions with it, regardless of how many entities are involved
b) have 3 controllers, one for each of the entity type (for specific actions associated with insertion and displaying specific information), and one for actions requiring data from both entities (basically just display, maybe some insert)
c) something else?
1) When linking or submitting a form to a controller, are query strings like MyAction?VarA=4&VarB=5... ok or should I switch to something like MyAction/4/5/. Does it really matter? I prefer to avoid creating all these special routes when I can
2)How do should one split up controllers and what they handle? Suppose I have 2 entities (or domain objects) that are related and am displaying them together in many views (however, a small number of actions for insertion and obtaining specific details occur in views where only one of the entity types is involved). Should I
a) use one controller and handle all actions with it, regardless of how many entities are involved
b) have 3 controllers, one for each of the entity type (for specific actions associated with insertion and displaying specific information), and one for actions requiring data from both entities (basically just display, maybe some insert)
c) something else?