From b9b3432e4150bc766b488830cf7636d36fd1fc81 Mon Sep 17 00:00:00 2001
From: Lukas Karsch <lk224@hdm-stuttgart.de>
Date: Wed, 19 Apr 2023 13:41:54 +0200
Subject: [PATCH] refactoring

---
 UML/TastyPages_Use-case.drawio                | 111 ++++++++----------
 src/main/java/mi/hdm/mealPlan/MealPlan.java   |  14 ++-
 .../mi/hdm/mealPlan/NutritionCalculator.java  |   4 -
 src/main/java/mi/hdm/recipes/Ingredient.java  |   3 +-
 .../java/mi/hdm/recipes/IngredientList.java   |  10 --
 .../mi/hdm/recipes/NutritionCalculator.java   |   9 ++
 .../java/mi/hdm/recipes/NutritionTable.java   |   9 +-
 src/main/java/mi/hdm/recipes/Recipe.java      |   4 +-
 .../java/mi/hdm/recipes/RecipeManager.java    |  19 ++-
 .../mi/hdm/shoppingList/ShoppingList.java     |   7 +-
 10 files changed, 104 insertions(+), 86 deletions(-)
 delete mode 100644 src/main/java/mi/hdm/mealPlan/NutritionCalculator.java
 delete mode 100644 src/main/java/mi/hdm/recipes/IngredientList.java
 create mode 100644 src/main/java/mi/hdm/recipes/NutritionCalculator.java

diff --git a/UML/TastyPages_Use-case.drawio b/UML/TastyPages_Use-case.drawio
index 0fe58f9..e0e5d65 100644
--- a/UML/TastyPages_Use-case.drawio
+++ b/UML/TastyPages_Use-case.drawio
@@ -1,4 +1,4 @@
-<mxfile host="app.diagrams.net" modified="2023-04-19T11:05:18.944Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" etag="TfVF3upebSLqdH9pMsNr" version="21.1.7" type="device" pages="2">
+<mxfile host="app.diagrams.net" modified="2023-04-19T11:39:45.984Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" etag="auBj7dBcp4-3Ku1kofR1" version="21.1.7" type="device" pages="2">
   <diagram name="Seite-1" id="guNTSU0fiwR1g74g93dq">
     <mxGraphModel dx="1434" dy="1623" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
       <root>
@@ -311,11 +311,11 @@
     </mxGraphModel>
   </diagram>
   <diagram id="IOxpQtQOinXd_60UH0zV" name="Seite-2">
-    <mxGraphModel dx="2416" dy="1519" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
+    <mxGraphModel dx="3218" dy="1964" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
       <root>
         <mxCell id="0" />
         <mxCell id="1" parent="0" />
-        <mxCell id="4rBL8TMRcDE2g0Xyakx7-3" value="7" style="swimlane;whiteSpace=wrap;html=1;rounded=0;" parent="1" vertex="1">
+        <mxCell id="4rBL8TMRcDE2g0Xyakx7-3" value="package : recipe" style="swimlane;whiteSpace=wrap;html=1;rounded=0;" parent="1" vertex="1">
           <mxGeometry x="-20" y="43" width="1170" height="740" as="geometry" />
         </mxCell>
         <mxCell id="khY43H2GbW4oralui55t-5" value="RecipeEditor" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="4rBL8TMRcDE2g0Xyakx7-3" vertex="1">
@@ -402,18 +402,14 @@
         <mxCell id="BmttCFs_K1xAuYzUHSLz-1" value="+ getAllCategories() : Set&amp;lt;Category&amp;gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="4db8lyx7makHAff3xmPV-5" vertex="1">
           <mxGeometry y="86" width="245" height="26" as="geometry" />
         </mxCell>
-        <mxCell id="ev62EXm1IyDULqRkRese-35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.629;entryY=1.055;entryDx=0;entryDy=0;entryPerimeter=0;" parent="4rBL8TMRcDE2g0Xyakx7-3" source="90y9bFiBt-Dw9IB2Oaka-1" target="VXFt1rTyLLwseOzf8AC8-1" edge="1">
+        <mxCell id="VXFt1rTyLLwseOzf8AC8-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="4rBL8TMRcDE2g0Xyakx7-3" source="90y9bFiBt-Dw9IB2Oaka-1" target="BmttCFs_K1xAuYzUHSLz-17">
           <mxGeometry relative="1" as="geometry">
             <Array as="points">
-              <mxPoint x="500" y="395" />
+              <mxPoint x="450" y="437" />
+              <mxPoint x="235" y="437" />
             </Array>
           </mxGeometry>
         </mxCell>
-        <mxCell id="ev62EXm1IyDULqRkRese-36" value="implements" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="ev62EXm1IyDULqRkRese-35" vertex="1" connectable="0">
-          <mxGeometry x="0.5375" y="2" relative="1" as="geometry">
-            <mxPoint y="36" as="offset" />
-          </mxGeometry>
-        </mxCell>
         <mxCell id="90y9bFiBt-Dw9IB2Oaka-1" value="Recipe&amp;nbsp;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="4rBL8TMRcDE2g0Xyakx7-3" vertex="1">
           <mxGeometry x="315" y="502" width="270" height="182" as="geometry">
             <mxRectangle x="20" y="150" width="80" height="30" as="alternateBounds" />
@@ -437,19 +433,17 @@
         <mxCell id="ev62EXm1IyDULqRkRese-1" value="- created : LocalDateTime" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="90y9bFiBt-Dw9IB2Oaka-1" vertex="1">
           <mxGeometry y="158" width="270" height="24" as="geometry" />
         </mxCell>
-        <mxCell id="ev62EXm1IyDULqRkRese-33" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.258;entryY=1.07;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1;exitY=0.25;exitDx=0;exitDy=0;" parent="4rBL8TMRcDE2g0Xyakx7-3" source="4LD2Q_2ablrLRUKtAQnm-8" target="VXFt1rTyLLwseOzf8AC8-1" edge="1">
+        <mxCell id="VXFt1rTyLLwseOzf8AC8-6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="4rBL8TMRcDE2g0Xyakx7-3" source="4LD2Q_2ablrLRUKtAQnm-8" target="BmttCFs_K1xAuYzUHSLz-17">
           <mxGeometry relative="1" as="geometry">
-            <mxPoint x="430" y="416" as="targetPoint" />
             <Array as="points">
-              <mxPoint x="290" y="456" />
-              <mxPoint x="430" y="456" />
-              <mxPoint x="430" y="396" />
+              <mxPoint x="155" y="437" />
+              <mxPoint x="235" y="437" />
             </Array>
           </mxGeometry>
         </mxCell>
-        <mxCell id="ev62EXm1IyDULqRkRese-34" value="implements" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="ev62EXm1IyDULqRkRese-33" vertex="1" connectable="0">
-          <mxGeometry x="-0.5103" relative="1" as="geometry">
-            <mxPoint x="62" y="-6" as="offset" />
+        <mxCell id="VXFt1rTyLLwseOzf8AC8-8" value="implements" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="VXFt1rTyLLwseOzf8AC8-6">
+          <mxGeometry x="0.5309" y="1" relative="1" as="geometry">
+            <mxPoint as="offset" />
           </mxGeometry>
         </mxCell>
         <mxCell id="4LD2Q_2ablrLRUKtAQnm-8" value="Ingredient" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="4rBL8TMRcDE2g0Xyakx7-3" vertex="1">
@@ -507,7 +501,7 @@
           <mxGeometry y="60" width="260" height="40" as="geometry" />
         </mxCell>
         <mxCell id="BmttCFs_K1xAuYzUHSLz-17" value="&amp;lt;&amp;lt;interface&amp;gt;&amp;gt;&lt;br&gt;&lt;b&gt;RecipeComponent&lt;/b&gt;" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="4rBL8TMRcDE2g0Xyakx7-3" vertex="1">
-          <mxGeometry x="380" y="290" width="190" height="104" as="geometry" />
+          <mxGeometry x="140" y="287" width="190" height="104" as="geometry" />
         </mxCell>
         <mxCell id="BmttCFs_K1xAuYzUHSLz-18" value="+ getName() : String" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="BmttCFs_K1xAuYzUHSLz-17" vertex="1">
           <mxGeometry y="26" width="190" height="26" as="geometry" />
@@ -550,43 +544,20 @@
         </mxCell>
         <mxCell id="ev62EXm1IyDULqRkRese-19" value="0..*" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="ev62EXm1IyDULqRkRese-18" vertex="1" connectable="0">
           <mxGeometry x="0.8861" y="-2" relative="1" as="geometry">
-            <mxPoint as="offset" />
+            <mxPoint x="2" y="-51" as="offset" />
           </mxGeometry>
         </mxCell>
-        <mxCell id="ev62EXm1IyDULqRkRese-22" value="1" style="endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.007;entryY=-0.075;entryDx=0;entryDy=0;entryPerimeter=0;" parent="4rBL8TMRcDE2g0Xyakx7-3" source="BmttCFs_K1xAuYzUHSLz-18" target="4LD2Q_2ablrLRUKtAQnm-15" edge="1">
+        <mxCell id="ev62EXm1IyDULqRkRese-22" value="1" style="endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;rounded=0;entryX=0.007;entryY=-0.075;entryDx=0;entryDy=0;entryPerimeter=0;" parent="4rBL8TMRcDE2g0Xyakx7-3" target="4LD2Q_2ablrLRUKtAQnm-15" edge="1">
           <mxGeometry x="-1" y="3" relative="1" as="geometry">
-            <mxPoint x="540" y="376" as="sourcePoint" />
+            <mxPoint x="290" y="467" as="sourcePoint" />
             <mxPoint x="700" y="376" as="targetPoint" />
             <Array as="points">
-              <mxPoint x="620" y="329" />
+              <mxPoint x="290" y="467" />
+              <mxPoint x="620" y="467" />
               <mxPoint x="620" y="403" />
             </Array>
           </mxGeometry>
         </mxCell>
-        <mxCell id="qvnAXoucquyjZ7kPEuXb-5" value="Singleton : IngredientList" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="4rBL8TMRcDE2g0Xyakx7-3" vertex="1">
-          <mxGeometry x="20" y="276" width="210" height="100" as="geometry" />
-        </mxCell>
-        <mxCell id="qvnAXoucquyjZ7kPEuXb-6" value="- ingredients : List&amp;lt;Ingredient&amp;gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="qvnAXoucquyjZ7kPEuXb-5" vertex="1">
-          <mxGeometry y="26" width="210" height="26" as="geometry" />
-        </mxCell>
-        <mxCell id="qvnAXoucquyjZ7kPEuXb-7" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="qvnAXoucquyjZ7kPEuXb-5" vertex="1">
-          <mxGeometry y="52" width="210" height="8" as="geometry" />
-        </mxCell>
-        <mxCell id="qvnAXoucquyjZ7kPEuXb-13" value="+ create(String name, Measurement unit) : void" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="qvnAXoucquyjZ7kPEuXb-5" vertex="1">
-          <mxGeometry y="60" width="210" height="40" as="geometry" />
-        </mxCell>
-        <mxCell id="ev62EXm1IyDULqRkRese-30" value="" style="endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;rounded=0;exitX=0.108;exitY=1.027;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.113;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" parent="4rBL8TMRcDE2g0Xyakx7-3" source="lNXn1_JIS0mlgrxrveIr-13" target="qvnAXoucquyjZ7kPEuXb-5" edge="1">
-          <mxGeometry x="-1" y="3" relative="1" as="geometry">
-            <mxPoint x="20" y="266" as="sourcePoint" />
-            <mxPoint x="180" y="266" as="targetPoint" />
-          </mxGeometry>
-        </mxCell>
-        <mxCell id="ev62EXm1IyDULqRkRese-31" value="" style="endArrow=diamondThin;endFill=0;endSize=24;html=1;rounded=0;entryX=0.254;entryY=1.103;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.198;exitY=-0.028;exitDx=0;exitDy=0;exitPerimeter=0;" parent="4rBL8TMRcDE2g0Xyakx7-3" source="4LD2Q_2ablrLRUKtAQnm-8" target="qvnAXoucquyjZ7kPEuXb-13" edge="1">
-          <mxGeometry width="160" relative="1" as="geometry">
-            <mxPoint x="-80" y="426" as="sourcePoint" />
-            <mxPoint x="80" y="426" as="targetPoint" />
-          </mxGeometry>
-        </mxCell>
         <mxCell id="ev62EXm1IyDULqRkRese-40" value="" style="endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=0;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.005;entryY=0.355;entryDx=0;entryDy=0;entryPerimeter=0;" parent="4rBL8TMRcDE2g0Xyakx7-3" source="lNXn1_JIS0mlgrxrveIr-12" target="I4bFckmwjJYNS_oseT-e-1" edge="1">
           <mxGeometry x="-1" y="3" relative="1" as="geometry">
             <mxPoint x="230" y="186" as="sourcePoint" />
@@ -600,6 +571,29 @@
             <Array as="points" />
           </mxGeometry>
         </mxCell>
+        <mxCell id="VXFt1rTyLLwseOzf8AC8-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.785;entryY=0.001;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="4rBL8TMRcDE2g0Xyakx7-3" source="lNXn1_JIS0mlgrxrveIr-1" target="4LD2Q_2ablrLRUKtAQnm-12">
+          <mxGeometry relative="1" as="geometry" />
+        </mxCell>
+        <mxCell id="lNXn1_JIS0mlgrxrveIr-1" value="NutritionCalculator" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="4rBL8TMRcDE2g0Xyakx7-3" vertex="1">
+          <mxGeometry x="880" y="224" width="280" height="78" as="geometry" />
+        </mxCell>
+        <mxCell id="lNXn1_JIS0mlgrxrveIr-4" value="+ calculate (Recipe r) : NutritionTable" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="lNXn1_JIS0mlgrxrveIr-1" vertex="1">
+          <mxGeometry y="26" width="280" height="26" as="geometry" />
+        </mxCell>
+        <mxCell id="VXFt1rTyLLwseOzf8AC8-9" value="+ calculate (Recipe r) : NutritionTable" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" vertex="1" parent="lNXn1_JIS0mlgrxrveIr-1">
+          <mxGeometry y="52" width="280" height="26" as="geometry" />
+        </mxCell>
+        <mxCell id="VXFt1rTyLLwseOzf8AC8-4" value="" style="endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;rounded=0;exitX=0.161;exitY=1.04;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.131;entryY=-0.043;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="4rBL8TMRcDE2g0Xyakx7-3" source="lNXn1_JIS0mlgrxrveIr-13" target="4LD2Q_2ablrLRUKtAQnm-8">
+          <mxGeometry x="-1" y="3" relative="1" as="geometry">
+            <mxPoint x="300" y="377" as="sourcePoint" />
+            <mxPoint x="80" y="437" as="targetPoint" />
+          </mxGeometry>
+        </mxCell>
+        <mxCell id="VXFt1rTyLLwseOzf8AC8-5" value="0..*" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="VXFt1rTyLLwseOzf8AC8-4">
+          <mxGeometry x="0.7378" y="1" relative="1" as="geometry">
+            <mxPoint as="offset" />
+          </mxGeometry>
+        </mxCell>
         <mxCell id="XnVSaR7xRqF0c78tSIC_-1" value="package : shoppingList" style="swimlane;whiteSpace=wrap;html=1;" parent="1" vertex="1">
           <mxGeometry x="1280" y="-350" width="300" height="290" as="geometry" />
         </mxCell>
@@ -625,7 +619,7 @@
           <mxGeometry y="138" width="240" height="26" as="geometry" />
         </mxCell>
         <mxCell id="xz0VCGe2YetrdaeYra_O-1" value="package : mealPlan" style="swimlane;whiteSpace=wrap;html=1;" parent="1" vertex="1">
-          <mxGeometry x="1250" y="414" width="620" height="250" as="geometry" />
+          <mxGeometry x="1250" y="414" width="230" height="250" as="geometry" />
         </mxCell>
         <mxCell id="xz0VCGe2YetrdaeYra_O-2" value="Sngleton : MealPlan" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="xz0VCGe2YetrdaeYra_O-1" vertex="1">
           <mxGeometry x="20" y="39" width="180" height="190" as="geometry" />
@@ -651,18 +645,6 @@
         <mxCell id="ev62EXm1IyDULqRkRese-5" value="+ get() : MealPlan" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="xz0VCGe2YetrdaeYra_O-2" vertex="1">
           <mxGeometry y="164" width="180" height="26" as="geometry" />
         </mxCell>
-        <mxCell id="lNXn1_JIS0mlgrxrveIr-1" value="NutritionCalculator" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="xz0VCGe2YetrdaeYra_O-1" vertex="1">
-          <mxGeometry x="300" y="39" width="280" height="52" as="geometry" />
-        </mxCell>
-        <mxCell id="lNXn1_JIS0mlgrxrveIr-4" value="+ calculateWeek(MealPlan plan) : NutritionTable" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="lNXn1_JIS0mlgrxrveIr-1" vertex="1">
-          <mxGeometry y="26" width="280" height="26" as="geometry" />
-        </mxCell>
-        <mxCell id="ev62EXm1IyDULqRkRese-38" value="" style="endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=0;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="xz0VCGe2YetrdaeYra_O-1" source="ev62EXm1IyDULqRkRese-4" target="lNXn1_JIS0mlgrxrveIr-4" edge="1">
-          <mxGeometry x="-1" y="3" relative="1" as="geometry">
-            <mxPoint x="260" y="156" as="sourcePoint" />
-            <mxPoint x="420" y="156" as="targetPoint" />
-          </mxGeometry>
-        </mxCell>
         <mxCell id="lNXn1_JIS0mlgrxrveIr-5" value="Singleton : App" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1">
           <mxGeometry x="1232" y="50" width="420" height="294" as="geometry" />
         </mxCell>
@@ -766,6 +748,15 @@
             <mxPoint y="-10" as="offset" />
           </mxGeometry>
         </mxCell>
+        <mxCell id="VXFt1rTyLLwseOzf8AC8-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.614;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="xz0VCGe2YetrdaeYra_O-3" target="VXFt1rTyLLwseOzf8AC8-9">
+          <mxGeometry relative="1" as="geometry">
+            <mxPoint x="1110" y="400" as="targetPoint" />
+            <Array as="points">
+              <mxPoint x="1032" y="492" />
+              <mxPoint x="1032" y="440" />
+            </Array>
+          </mxGeometry>
+        </mxCell>
       </root>
     </mxGraphModel>
   </diagram>
diff --git a/src/main/java/mi/hdm/mealPlan/MealPlan.java b/src/main/java/mi/hdm/mealPlan/MealPlan.java
index 9cea4ca..bf805f6 100644
--- a/src/main/java/mi/hdm/mealPlan/MealPlan.java
+++ b/src/main/java/mi/hdm/mealPlan/MealPlan.java
@@ -1,5 +1,11 @@
 package mi.hdm.mealPlan;
 
+import mi.hdm.recipes.NutritionTable;
+import mi.hdm.recipes.Recipe;
+
+/**
+ * Allow the user to create a meal plan for the week. The user can check out his nutrition scores for the week.
+ */
 public class MealPlan {
     private static final MealPlan mealPlan = new MealPlan();
 
@@ -7,11 +13,15 @@ public class MealPlan {
         return mealPlan;
     }
 
-    public void addRecipeTomMealPlan(Recipe recipe, int day) {}
+    public void addRecipeToMealPlan(Recipe recipe, int day) {}
 
     public void clear(int day) {}
 
     public void clear() {}
 
-    public void get(int day) {}
+    public void getRecipeForDay(int day) {}
+
+    public NutritionTable getNutritionTable() { return null; }
+
+    public NutritionTable getNutritionTable(int day) { return null; }
 }
diff --git a/src/main/java/mi/hdm/mealPlan/NutritionCalculator.java b/src/main/java/mi/hdm/mealPlan/NutritionCalculator.java
deleted file mode 100644
index 09d2ae4..0000000
--- a/src/main/java/mi/hdm/mealPlan/NutritionCalculator.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package mi.hdm.mealPlan;
-
-public class NutritionCalculator {
-}
diff --git a/src/main/java/mi/hdm/recipes/Ingredient.java b/src/main/java/mi/hdm/recipes/Ingredient.java
index e55a156..d5177a8 100644
--- a/src/main/java/mi/hdm/recipes/Ingredient.java
+++ b/src/main/java/mi/hdm/recipes/Ingredient.java
@@ -1,8 +1,9 @@
 package mi.hdm.recipes;
 
 public class Ingredient implements RecipeComponent {
-
     private Measurement unit;
+    private NutritionTable nutritionTable;
+
 
     public String getName() {
         return null;
diff --git a/src/main/java/mi/hdm/recipes/IngredientList.java b/src/main/java/mi/hdm/recipes/IngredientList.java
deleted file mode 100644
index 36b041b..0000000
--- a/src/main/java/mi/hdm/recipes/IngredientList.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package mi.hdm.recipes;
-
-import java.util.List;
-
-public class IngredientList {
-
-    private List<Ingredient> ingredients;
-
-    public void create (String name, Measurement unit) {}
-}
diff --git a/src/main/java/mi/hdm/recipes/NutritionCalculator.java b/src/main/java/mi/hdm/recipes/NutritionCalculator.java
new file mode 100644
index 0000000..f465c55
--- /dev/null
+++ b/src/main/java/mi/hdm/recipes/NutritionCalculator.java
@@ -0,0 +1,9 @@
+package mi.hdm.recipes;
+
+import mi.hdm.mealPlan.MealPlan;
+
+public class NutritionCalculator {
+    public static NutritionTable calculateNutritionTable(Recipe recipe) { return null; }
+
+    public static NutritionTable calculateNutritionTable(MealPlan mealPlan) { return null; }
+}
diff --git a/src/main/java/mi/hdm/recipes/NutritionTable.java b/src/main/java/mi/hdm/recipes/NutritionTable.java
index cc171df..e600431 100644
--- a/src/main/java/mi/hdm/recipes/NutritionTable.java
+++ b/src/main/java/mi/hdm/recipes/NutritionTable.java
@@ -3,10 +3,13 @@ package mi.hdm.recipes;
 import java.util.HashMap;
 
 public class NutritionTable {
+    private final HashMap<Nutrition, Double> table;
 
-    private HashMap<Nutrition, Double> table;
+    public NutritionTable(HashMap<Nutrition, Double> table) {
+        this.table = table;
+    }
 
-    public NutritionTable getNutritionForRecipe (Recipe recipe) {
-        return null;
+    public NutritionTable getTable() {
+        return this;
     }
 }
diff --git a/src/main/java/mi/hdm/recipes/Recipe.java b/src/main/java/mi/hdm/recipes/Recipe.java
index ac1cda1..6588716 100644
--- a/src/main/java/mi/hdm/recipes/Recipe.java
+++ b/src/main/java/mi/hdm/recipes/Recipe.java
@@ -13,13 +13,13 @@ public class Recipe implements RecipeComponent {
     private Set<Category> categories;
     private Integer preparationTimeMins;
     private LocalDateTime created;
+    private NutritionTable nutritionTable;
 
     public String getName() {
-
         return null;
     }
     public NutritionTable getNutritionTable() {
-        return null;
+        return nutritionTable;
     }
     public int getID() {
         return 0;
diff --git a/src/main/java/mi/hdm/recipes/RecipeManager.java b/src/main/java/mi/hdm/recipes/RecipeManager.java
index 68a4bf4..ec6a78b 100644
--- a/src/main/java/mi/hdm/recipes/RecipeManager.java
+++ b/src/main/java/mi/hdm/recipes/RecipeManager.java
@@ -3,12 +3,25 @@ package mi.hdm.recipes;
 import java.util.List;
 
 public class RecipeManager {
+    private final List<Recipe> recipes;
+    private final Categories categories;
+    private final List<Ingredient> ingredients;
+    private final NutritionCalculator nutritionCalculator;
 
-    private List<Recipe> recipes;
-    private Categories categories;
-    private IngredientList ingredients;
+    public RecipeManager(List<Recipe> recipes, Categories categories, List<Ingredient> ingredients, NutritionCalculator nutritionCalculator) {
+        this.recipes = recipes;
+        this.categories = categories;
+        this.ingredients = ingredients;
+        this.nutritionCalculator = nutritionCalculator;
+    }
 
     public void addRecipe(){}
+
     public void deleteRecipe(int i) {}
+
     public void editRecipe (int i) {}
+
+    public void addIngredient() {}
+
+    public void deleteIngredient() {}
 }
diff --git a/src/main/java/mi/hdm/shoppingList/ShoppingList.java b/src/main/java/mi/hdm/shoppingList/ShoppingList.java
index d1e3c5f..bd9d88b 100644
--- a/src/main/java/mi/hdm/shoppingList/ShoppingList.java
+++ b/src/main/java/mi/hdm/shoppingList/ShoppingList.java
@@ -1,8 +1,13 @@
 package mi.hdm.shoppingList;
 
+import mi.hdm.recipes.Ingredient;
+
 import java.util.HashMap;
 import java.util.Map;
 
+/**
+ * Shopping list that the user can add ingredients to. The elements on the list can be marked as done or undone.
+ */
 public class ShoppingList {
     private final Map<Ingredient, Boolean> list;
 
@@ -13,7 +18,7 @@ public class ShoppingList {
     }
 
     public static ShoppingList getInstance() {
-        return list;
+        return shoppingList;
     }
 
     public void clear() {}
-- 
GitLab