This app uses following components:
Dagger2
MVVM Architecture
Room Database
RXJava/Android
Mockito for test
-
Fragment: Its role is to register listener and pass events to corresponding views.
-
Implementation: This is the veiw where Inflation and rendering of view happens.There is no chain of dependencies from Fragment to FragmentImpl.This allows us to demostrate Dependency Inversion Principle of SOLID principle.This allows to swap different implementations of SpecificViewMvc very easily, which can be extremely beneficial (e.g. AB testing of different implementations of a screen) and makes it more readable.
-
View: Interface which contains Listeners and common methods for view.
-
Usecase: This class will segragate out all web service relaled calls to have clean architecture.
-
Observable design pattern: This is used heavily for any events. Fragments will recieve events only if it is registered. This is achieved with BaseView, ObservableView and BaseObservable classes.
-
Factory design pattern: Fragment creation happens at runtime based on the classname passed. This is done through ViewFactory class.
App uses Room database to store Wishlist Data. This is achieved though creating model,dao and
database whihc is initillized using Dagger.
App uses shopping repository as single point of truth for webservice and database
management(ShoppingRepository class)
RX is used for multithrading for POST, GET, DELETE and GET.
This is used in combination with Retrofit.(ShoppingService.class)
App uses Dagger2 as dependency library. This is done to reduce boilerplate code.
This has been acheived through seprating it
into component, module. Also to resolve Viewmodel DI issue seperate callses are created as
ViewModelProviderFactory class
and bind Annotations.
Unit test has been added for UI component - ProductListFragment and ProductListViewModel. As all other UI
components have same hierarchy and structure, it will be replica for other classes. Not adding it for
other classes as it will be same. :)