-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Refactoring of KnParameters to an interface #888
Comments
KnParameters
to an interface
ballot is over, let's tackle that refactoring. Thanks ! /assign rhuss |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle-stale |
/remove-lifecycle stale |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale |
This is refactoring should be considered to be implemented along with the extraction of the shared code #1039 |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale @dsimansk Not sure if we can do it within the current scope of extracting shared code or whether we should consider this story for a second step refactoring. |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale |
Co-authored-by: Markus Thömmes <markusthoemmes@me.com>
Curently we are using a struct
KnParams
as the context that we pass down into specific commands so that they can access the various services:This struct was mainly added in this form for allowing injection of fake clients for unit testing. However, this construct has some drawbacks:
fixedCurrentNamespace
or also theOutput
writer which should be used from the command itself.Initialize()
which is hard to understand why that call is needed from business logic PoVKnParameters
is a poor name because it does not reflect its purpose (i.e. the services included are not parameters, but part of the environment/context for which a command is created).The suggested refactoring is:
KnContext
interface with direct access to the services needed.KnDefaultContext
,KnFakeContext
(for fake based testing) andKnMockContext
(for mock based testing)KnFakeContext
andKnMockContext
the can use a buffer for these streams.Please vote for this refactoring here with 👍 / 👎 , preferably with some comment to reason about your vote.
The text was updated successfully, but these errors were encountered: