You should use a controller for Getting request data; Getting model & view instances; Updating model states; Calling model action methods (e.g. delete, save, remove); Calling view methods to render a template.
You should not use a controller for Database task; Manipulating model data; Rendering templates. model & view tasks
Joomla MVC default task as it is Main component’s file request data calls Controller default task calls JController’s display() Model & view objects gets inserts Model into view calls JView’s display() gets Model data renders Template
The best way to figure out the Joomla framework is to dig into the code!
After digging JController methods you can find out /libraries/joomla/application/component/controller.php How to insert other than the default model into your view class How to add another location for your model & view files How to set a default model state … and many more
Code Optimization Write code Go! Write a bit more code Think over
A simple optimization Edit, publish, unpublish, save order, order up, order down, cancel, save, remove Base admin model Base admin controller Base admin view Helper classes Get ordering, save order, move, check out, check in, publish, remove The most used variables: option, document, view, controller, layout, etc. Everything that can be reused in templates