I'm using the current layer topology:
1) dao 2) service 3) controllers(presentation)
In one of my controllers I'm receiving the following call (from clients):
public PlayerStatisticsDTO getPlayerStatistics(int playerId);
The controller should now delegate the call to the service layer.
Problem is, if i create a method like:
public PlayerStatisticsDTO getPlayerStatistics(int playerId);
in my Service I'm actually making my service layer aware of the DTO object!
I believe this is a bad practice (or not?)
So my other alternative that i came up with is creating a new class:
public class PlayerStatistics {...}
and then calling in my controller:
PlayerStatistics stats = this.service.getPlayerStatistics(playerID);
return toDTO(stats);
The problem with this solution is that i dont have any use for this class at all in my project so it seems like an unnecessary duplicated code