deploykit icon indicating copy to clipboard operation
deploykit copied to clipboard

Use Factory Pattern for public API

Open pogobanane opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe.

Extending features will explode parameters for many/most functions.

Describe the solution you'd like

Factory pattern: Work on a factory object to hold all settings and configuration variables. This keeps function signatures at more constant length over time.

Describe alternatives you've considered

Insanely long function signatures are needed for all parent functions when adding a new parameter to a low-level function.

pogobanane avatar Aug 26 '22 09:08 pogobanane

You mean argument list passed to run, run_local etc?

Mic92 avatar Aug 26 '22 10:08 Mic92

yes. Extending DeployHost with more features will become quite ugly IMHO. https://github.com/pogobanane/deploykit/commit/3270cc5af31af645925cb8a85337bb0005ecebb2

pogobanane avatar Aug 26 '22 10:08 pogobanane

Is this possible while maintaining type checks?

Mic92 avatar Aug 29 '22 11:08 Mic92