[phpMyAdmin Developers] Refactoring a controller

Atul Pratap Singh atulpratapsingh05 at gmail.com
Thu Oct 29 11:37:00 CET 2015


Hi,

On 29 October 2015 at 10:56, Marc Delisle <marc at infomarc.info> wrote:

> Hi Madhura and Atul,
>
> I was looking at indexAction() in DatabaseStructureController.class.php,
> which is 566 lines. I find it too long to be manageable, and PMD agrees
> [0].
>
> Do you consider this method a work in progress? Does MVC mandate that
> indexAction() should remain that size?
>
>
I agree it's a work in progress and needs further refactoring. Looking at
it, I think it pretty much contains only the logic that just displays the
Database_Structure index page (or may be the logic for "Drops/deletes/etc.
multiple tables if required" needs to go into separate action?).
Thereafter, it can surely be further broken into some helper functions or
sub-actions for readability/reuseability.
Also, it's size will further reduce once other actions
like addRemoveFavoriteTablesAction are called directly, instead of, via
indexAction.



-- 
Regards

Atul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.phpmyadmin.net/pipermail/developers/attachments/20151029/80dd5443/attachment.html>


More information about the Developers mailing list