From 7d43ca0afc4dbb08f062f750fc1471fdbcd21376 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Fri, 25 Nov 2016 01:04:26 +0100 Subject: [PATCH] MVC, Model should know nothing about View. Service is in Model layer, it should not be dealing with sessions (View) --- TDD/src/main/java/org/craftedsw/tripservicekata/trip/TripService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TDD/src/main/java/org/craftedsw/tripservicekata/trip/TripService.java b/TDD/src/main/java/org/craftedsw/tripservicekata/trip/TripService.java index 5a19beb..6a195b8 100644 --- a/TDD/src/main/java/org/craftedsw/tripservicekata/trip/TripService.java +++ b/TDD/src/main/java/org/craftedsw/tripservicekata/trip/TripService.java @@ -29,6 +29,8 @@ public class TripService { return tripList; } + // In MVC the Model layer should know nothing about the view. + // Service is in Model layer, so we have to get rid of this method. protected User getLoggedInUser() { User loggedUser = UserSession.getInstance().getLoggedUser(); return loggedUser; -- 2.1.4