ucsb-cs56-projects / cs56-android-smoke-signals

-
GNU General Public License v3.0
1 stars 7 forks source link

Refractor Room Persistence Library #57

Closed BrianEKim closed 6 years ago

BrianEKim commented 6 years ago

The Room Database("Storage") in Smoke-Signal is composed of AppDatabase, PhoneNumber, PhoneNumberDao, and DaoManager. The Room Database should be composed of three components Entity, Dao, and Database. The AppDatabase serves as the Database, PhoneNumber serves as the Entity, PhoneNumberDao serves as Dao, and the DaoManager serves as an extra abstraction layer over AppDatabase. DaoManager also has some component that should be in the AppDatabase. There is no need to have DaoManager. For this issue, I'm going to remove DaoManager and insert a new getDatabbaseInstance method in order to make sure we are using the same Database (having multiple instances of Database is expensive). Also edit smsManager to account for these changes since the abstraction for AppDatabase is gone.

-Learned about how to set up Room Persistence Library using these Links: https://android.jlelse.eu/room-store-your-data-c6d49b4d53a3 https://riggaroo.co.za/android-architecture-components-looking-room-livedata-part-1/ https://www.tutorialspoint.com/android/android_shared_preferences.htm https://developer.android.com/reference/android/arch/persistence/room/Query.html

seemantasaha commented 6 years ago

Implemented Singleton pattern. W18 OK for 200 points.

seemantasaha commented 6 years ago

Resolved.