Long Parameter List: Too Much Information
Long Parameter List
Member functions that take too many parameters produce client code that is awkward and difficult to work with.
It's common to see parameter lists grow and grow when a member function requires too much data.Callers of the member function often have an awkward time assembling all of the data and the resulting code is usually not too pretty.In the example below, 11 parameters are passed into UserManager
's create(...)
member function.
(Ugly wrapping or a horizontal scrollbar are other signs of the awkwardness of this smell.)
class OwnershipTest:
def createUserInGroup(self):
groupManager = GroupManager()
group = groupManager.create(TEST_GROUP, False, GroupProfile.UNLIMITED_LICENSES, "", GroupProfile.ONE_YEAR, None) user = userManager.create(USER_NAME, group, USER_NAME, "joshua", USER_NAME, LANGUAGE, False, False, datetime.date.today(), "blah", datetime.date.today())
(Reading...)
Formatting Hints:
To format... | use this markup: |
---|---|
source code | {source:lang=java|lineNumbers=false}...{source} (Supported languages: java, cpp, csharp, c, python.) |
bold text | __some text__ |
italicized text | ~~some text~~ |
underlined text | @@some text@@ |
a method or class name | ``myMethod(...)`` |