That depends, is session.ID just an int? If it is, I would rather pass the entire session in, since getGamesBySession(session)
is a lot clearer than getGamesBySession(int)
.
However, you could also consider wrapping the int into a SessionIdentifier
object, which gives a bit more semantic meaning to the value. getGameBySession(SessionIdentifier)
is equally as clear and would prevent you from passing in some random int from elsewhere...