Assume a base controller class which declares a composite view object.
The base controller class is then inherited from and extended. The sub-class needs to manipulate the view which is declared in the super-class.
Whats best and why:
1) Keep the view class as protected so derived classes have access to it - it's my common practice to keep variables private.
2) Provide the required API to manipulate the view in the base controller - starting to feel like MVP instead of MVC?
Perhaps a trivial view API such GetView() would suffice.
What do you say and why?
Controller hierarchies and composite views
Moderator: General Moderators
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg