On Sun, May 13, 2012 at 5:37 PM, Madhura Jayaratne <madhura.cj(a)gmail.com>wrote;wrote:
On Sun, May 13, 2012 at 12:42 PM, Thilina Buddika Abeyrathna <
thilinaabeyrathna(a)gmail.com> wrote:
Hi Marc,
when I'm writing functions for columns of insertForm I need to pass all
the following parameters to the functions.
$field, $backup_field, $field_name_appendix,
$unnullify_trigger, $tabindex, $tabindex_for_value, $idindex, $data
So function signature is very long which is somewhat ugly, Is it ok to
have a global parameter array for insert_edit.lib.php file. Does this break
the refactoring?
Hi Thilina,
Whenever you encounter a long list of parameters, I think it is a good
idea to evaluate whether your method is doing too much inside it, whether
it is possible to logically break your function into few smaller ones, each
requiring only few parameters.
Secondly if the parameters logically fit together you can introduce
parameter objects that would encapsulate the parameters as Poitr pointed
out in some other thread.
If non of the above applies I agree with Marc as it would make things
clearer.
--
Thanks and Regards,
Madhura Jayaratne
Hi Marc,
There are HTML code block from line 438 in the tbl_change.php file(after my
last commit [0]). It doesn't mix with much PHP tags. It is somewhat
readable.
Do I need to implement several functions to render this HTML block. Can you
give me a suggestion..
[0] -
https://github.com/thilinaa/phpmyadmin/commit/9d6c38daf6a98d915a34391bddb98…
--
Regards.
Thilina Buddika Abeyrathna,
Department of Computer Engineering,
Faculty Of Engineering,
University of Peradeniya,
Sri Lanka.