I am fairly new to Design Patterns in programming, and I am trying to learn them by creating recipes and a meal. There can be many recipes but only one meal.
Using Builder:
Create a Recipe
, which will contain a name, ingredients, etc.
Using Singleton:
Instantiate my CurrentMeal
, which should contain an ArrayList<Recipe>
. I also should be able to access a Recipe
inside my CurrentMeal
.
While I believe I understand Builder
, I am not sure I understand Singleton
all that well. Am I approaching this problem in an appropriate manner? If not, any suggestions as to an approach to take would be greatly appreciated. Thanks in advance.