This question is maybe opinion based but i am wondering which principle should i use. Here is my situation.
I have a class named TravelOffer. This class looks like this:
public class TravelOffer
{
private final long id;
private final StartZone startZone;
private final EndZone endZone;
private final List<Waypoint> waypoints;
private final Period startOff;
private final User travelCreator;
private final List<User> participantsList;
private final TravelExtras travelExtras;
private final CandidateApprovement candidateApprovement;
private int numberOfSeats;
private double pricePerPerson;
private Luggage luggage;
private boolean additionalLuggageTransport;
private String additionalDescription;
}
As u see there are the following attributes:
User tavelCreator
and List<User> participantsList
What i am wondering is should it be like this or simply to replace the User object with an String userId and then from a singleton class to get the User object which will be in a Hashmap.
Any ideas?