Skip to main content
August 11, 2008
Question

What to do when the FrontController grows very big

  • August 11, 2008
  • 2 replies
  • 826 views
What do I do when the frontcontroller of my application becomes monolithic in size? Say there are now a thousand different user gestures. Is it considered best practice to write 1000 "addCommand" lines of code in a single file? Is there a recommended practice for subclassing an application's FrontController? Could there ever be multiple FrontControllers in an application, perhaps one for each logical partition of the application?
This topic has been closed for replies.

2 replies

August 13, 2008
That's a good pointer. It sounds like we would want to create independent modules each with its own Cairngorm loop. So now the question is how do we tie each of these modules together? Is each module considered to be a "View" in the context of the big application? This way, it can receive data-binding from the big application, and dispatch events into the big application.

I want to map this out in a flowchart, and start thinking about "nested Cairngorm loops". This may solve a lot of maintenance problems associated with having one giant-squid sized FrontController.
Participating Frequently
August 11, 2008
Typically an application with thousands of use cases and user gestures naturally lends itself to a module based design, in which case, and this may very well be a conversation in itself, seperate FrontControllers could be used, one for each module, and a shared FrontController for events and commands which are common amongst all modules.

Hope that helps.
Eric