Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Take advantage of the Strategy Pattern in the Prompt class #428

Open
aboimpinto opened this issue Sep 20, 2018 · 2 comments
Open

Take advantage of the Strategy Pattern in the Prompt class #428

aboimpinto opened this issue Sep 20, 2018 · 2 comments

Comments

@aboimpinto
Copy link
Contributor

The prompt class have a huge number of dependencies in order to execute all the prompt actions. Instead if all this dependencies, we should implement the Strategy Pattern where each strategy will be responsible for his action and has his own dependencies (constructor injection).

@shargon
Copy link
Member

shargon commented Oct 31, 2018

This problem is because there are too much abstractions. When you need to use the code, you need to inject all of this classes :P, I think that the solution is reduce the abstraction level.

@osmirnov
Copy link
Collaborator

Since we introduced PromptControllers it is much better now. Although, I see some dependencies just injected but not used.

  1. NetworkManager is not needed https://github.com/CityOfZion/neo-sharp/blob/development/src/NeoSharp.Application/Client/Prompt.cs#L91
  2. Blockchain dep has to use containerBuilder.OnBuild hook instead
    _blockchain.InitializeBlockchain().Wait();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants