Skip to content

Implement Factory for Creating Optimizely::Project instances to Avoid Passing in a Large Number of Positional Arguments #243

Closed
@aagrawal2001

Description

@aagrawal2001

The constructor for Optimizely::Project expects 10 positional arguments. This is pretty unwieldy because it's hard for a caller to remember which argument is which. It also requires a bunch of nil values to be passed in if only some of the non-default values are desired.

It would be helpful to introduce a factory that takes in keyword arguments as input and constructs the Project instance. Since there are probably existing callers, we can't remove the constructor with positional arguments.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions