-
Notifications
You must be signed in to change notification settings - Fork 1
Design Patterns
kylewoo235 edited this page Feb 20, 2016
·
1 revision
Adapter pattern, seen in the StorageAccessor class (app/src/main/java/org/cook_e/data/StorageAccessor.java). The ui expects to be able to search for recipes by title and author but the actual SQLAccessors require ids to query the database. The StorageAccessor manages the mapping between title/author and id and allows for the ui to search recipes with only titles and authors
Singleton pattern, seen in the App class (app/src/main/java/org/cook_e/cook_e/App.java). Our application uses a single Context and StorageAccessor object across the entire app and so any activities within the app will call getAppContext() and getAccessor() to get the Context and StorageAccessor respectively