Refactoring - Long parameter list

Today, i have read a few parts of the Refactoring book of Martin Fowler. I am very glad that i have got some good practice experience from it.
I am doing the PIMS project. I am trying to refactor my code after functions run well.
There is one method with a long parameter list in the refactored method. So how to avoid the ugly codes?
There are three ways in the book:
      1. Using the method directly to replace some parameters.
      2. Using the preserve whole object to replace some parameters. If it will mess up your dependency structure, don't use this way.
      3. Using the creating the Oject for the long parameter list to replace the parameter list.
We also should know that we should have more details about the real exsecise.
posted @ 2009-08-04 16:16  它家  阅读(211)  评论(0编辑  收藏  举报