LogicController instead of ViewController

Problem definition

The growing complexity of an XAF application results in adding a lot of Controllers (including ViewController) to the project. XAF logic of using Controllers creates the entire set of Controllers for each new Frame even in case the Controller will not be activated on that Frame. All created Controllers complete the full activation/deactivation cycle during the life cycle of the Frame object.


To solve this problem, Xafari suggests using LogicController instead of some ViewControllers. LogicController has the same functionality but is not included into the list of Controllers for being not a Controller formally.

Not all ViewControllers can be replaced with LogicController in the application. This approach works only for those Controllers intended to implement and customize the fundamental logic of the View without implementing any Actions.

The detailed info on using LogicController can be found in the Logic Controllers section.

Effects of using

  • Memory optimization;
  • UI performance optimization.