UML Class Diagram - lagecamp/CMPUT301W13T02 GitHub Wiki
Third Version (generated from code -- March 29, 2013)
This is a general view of the UML class diagram. Some information has been omitted in order to make it clearer. The picture below depicts the model. The class RecipeModel stores Recipes and the class MyKitchen stores the Ingredients the user has. A Recipe has a list of the Ingredients it needs. There are two singletons of the class RecipeModel in the application, one for dealing with the local recipes (that can be either downloaded or created by the user) and the other one for dealing with the cached recipes.
The class RemoteRecipes is the one that deals with publishing/downloading information to/from the server. It does not inherit from the Model class, because it is not observable (the application is not able to know whether the sever has changed). The class RemoteRecipes works as a facade with respect to calling the methods that are offered by the server. With respect to sharing recipes, the methods that convert a Recipe to an email format are located inside the Recipe class.
In the picture below, we present some views and their relationships with the Controller class. Notice that the AddEditIngredientActivity and AddEditCommentsActivity are not associated with neither the model nor the controller. In the case of AddEditIngredientActivity, that's because it's used twice in the code: (1) to add/edit an ingredient from the kitchen, (2) to add/edit an ingredient from a recipe. In the case of AddEditCommentsActivity, it's because the new comment can be either stored locally or sent to the server, and the activity does not know the destination of the new comment.
In the picture below, we present the activities and how they relate to each other. An arrow from an activity A to an activity B means that you can go from A to B. The controls that allow the user to search for recipes are in MainActivity.
In the picture below, we present the Controller and its relationship with the SearchResult class. The SearchResult class encapsulates the result of a search, that can come from the local or the remote database. It could also come from the cached recipes.
Second Version (generated from code -- March 7, 2013)
This is a general view of the UML class diagram. Some information has been omitted in order to make it clearer. The picture below depicts the model. The classe RecipeModel stores Recipes and the class MyKithcen stores the Ingredients the user has. A Recipe has a list of the Ingredients it needs.
The names of the classes in the model have been changed in order to address the feedback from the previous part. The classes that deal with publishing and sharing are not shown because they haven't been implemented yet.
In the picture below, we present some views and their relationships with the Controller class. Notice that the AddEditIngredientActivity is not associated with neither the model or the controller. That's because it's used twice in the code: (1) to add/edit an ingredient from the kitchen, (2) to add/edit an ingredient from a recipe. AddEditIngredientActivity will return the edited/added/deleted ingredient to the caller activity and this one will be responsible to communicate with the controller.
In the picture below, we present the activities and how they relate to each other. An arrow from an activity A to an activity B means that you can go from A to B. The controls that allow the user to search for recipes are in MainActivity.
First Version
This is a general view of the UML class diagram. Some information has been omitted in order to make it clearer. The picture below depitcs the classes that store recipes and the ingredients of MyKitchen. There are also the classes that deal with publishing (the RemoteDatabase) and sharing (the RecipeShare). The class RecipeManager stores all types of recipes (cached, downloaded or local)
In the picture below, we present some views and their relationships with the Controller class.
In the picture below, we present the important views and how they relate to each other. The activity ViewRecipeActivity can view all types of recipes. If it is a remote recipe, the buttons Edit and Publish won't appear.