From: Gustavo Martin Morcuende Date: Fri, 25 Nov 2016 00:04:26 +0000 (+0100) Subject: MVC, Model should know nothing about View. X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=7d43ca0afc4dbb08f062f750fc1471fdbcd21376;p=JavaForFun MVC, Model should know nothing about View. Service is in Model layer, it should not be dealing with sessions (View) --- 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;