Closed ericcornelissen closed 7 years ago
@ericcornelissen Here is the link, I also had made a comment about it in #59 https://github.com/ericcornelissen/NervousFish/pull/59/files/999f4c96e64c457960824fb15a67f99fc4b2106e#diff-c5abb3af466f8817cb122941c6e88cb4R141
Relevant Issues: #27
Related Pull Requests: n/a
What
With this pull request a GSON implementation of the database will be added which, for now, is capable of:
Get a specific contact from the database (i.e. all information about that contact, name+key).Why
We want to store the contacts on the phone so they can be viewed/used at a later point in time
How
The database adapter in the PR is implemented using Google's gson, as a result the database is implemented in JSON files.
Alternative implementation
We have considered using other simple text-based database implementation (such as .csv) but felt that a JSON implementation is the right combination of simple and extensible.
Notes
ExampleUnitTest
has been removed as this is the first PR with actual unit tests.KeyAdapter
in themodules/database
package is needed to convert the arbitrary key representation in the database to an actual key POJO implementing theIKey
interface.IKey
implementing class needs agetType()
method so theKeyAdapter
can use the type to figure out what instance ofIKey
it must create when reading the database.ServiceLocator
(this also exists in develop), so there might be some issues but these will be fixed soon