#Room Booker Project ##Project structure ###MVP gradle module Java module with no Android dependencies. It contains following packages:
.mvp
- a package that contains all classes directly related to Model-View-Presenter architecture..mvp.model
- Model classes.mvp.presenter
- Presenters. They responds to UI actions, uses usecases to operate modify model objects and control View elements depending on use case results. It subscribes to observable returned by usecaseexecute()
method..mvp.view
- View interfaces that should be implemented by Android Activities, Fragments, or any other UI component.
.domain
- contains use cases that are used to operate on Model objects. Each use case implementsUsecase
interface that containsexecute()
that returns rxJavaObservable
object..repository
- containsRepository
interface used by use cases to operate on model. Implementation for this interface is provided by Android module using Retrofit.
###App gradle module Android gradle module.
.activity
- Android activities, they can be treated as MVP Views by implementing correspondingView
interfaces frommvp
gradle module..fragment
- Android fragments. Like activities, they can be treated as Views..adapter
- adapters for RecyclerViews and ViewPagers.gson
- classes forgson
JSON parser used to parse network responses..rest
- implementation of mvpRepository
interface with Retrofit 2 library..injector
- Dagger 2 related classes.scope
- Two custom scopes are defined:PerApplication
andPerActivity
..module
-ApplicationModule
andNetworkModule
arePerApplication
defined modules.NetworkModule
provides implementation forRepository
interface. The rest of modules havePerActivity
scope.EventModule
andCalendarsModule
provides injections for presenters and use cases defined inmvp
gradle module..component
- containsdagger
components.ApplicationComponent
providesPerApplication
scoped dependencies. Rest of components providePerActivity
scoped dependencies.
##Launching stub backend service
- Install
ruby
on your machine - Install Sinatra framework gem using
sudo gem install sinatra
- Launch backend service from
backend
folderruby sinatra.rb
##Limitations of mocked API
Responses from sinatra framework service are based on static JSON files which are located in \backend
folder. There is no implementation for storing data.
POST request operation for events have mocked response with static event in body - it has no influence on events list. Also POST request has no error handling for operation, so adding events operation is always successful. Sinatra service implementation is added only to show the general structure of API interface.
##Used libraries
##Copyright
Published under the MIT License. Copyright (c) 2015 Macoscope sp. z o.o.