Page 1 of 1

Controller hierarchies and composite views

Posted: Mon Jul 16, 2007 8:19 pm
by alex.barylski
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?