4seer / openflutterecommerceapp

Open Flutter E-commerce App
GNU General Public License v3.0
849 stars 387 forks source link

shows that there is no difference in DI variants #116

Closed Yahhi closed 4 years ago

Yahhi commented 4 years ago

Bloc can give the same results as Get It. If we will use BLOC, it can give the same dependency injection functionality as GetIt. Screen can have no mentions of repository classes. Additionally just as a variant - NetworkRequest class. Sometimes it is not a good idea to wrap all requests in WoocommerceWrapper implementation as it is in your code right now. It will require different input parameters and sometimes output shouldn't be json decoded. And why should it be provided globally? With my network request, it can be easier to maintain parameters. Or maybe I just don't like to have so much global singletons. :)

4seer commented 4 years ago

Bloc can give the same results as Get It. If we will use BLOC, it can give the same dependency injection functionality as GetIt. Screen can have no mentions of repository classes. Additionally just as a variant - NetworkRequest class. Sometimes it is not a good idea to wrap all requests in WoocommerceWrapper implementation as it is in your code right now. It will require different input parameters and sometimes output shouldn't be json decoded. And why should it be provided globally? With my network request, it can be easier to maintain parameters. Or maybe I just don't like to have so much global singletons. :)

May be you just don`t like to have so much global singletons.

I relocated your class NetworkRequest and SortRules json conversion right in the development branch. Not using it anywhere. Will possible refactor the code and utilize it.

If there is nothing more than that, please, remove pull request and let me know.