← Back to team overview

mugle-dev team mailing list archive

How to get a GameVersion by Game + Version

 

I noticed that GameVersion has only got a getByKey method, and so do a lot
of other services. Is there something I'm missing here? Getting something by
key doesn't seem to be particularly helpful.

I am adding a new method to GameVersionService that takes a Game and version
number and gets the associated version. Is this a good interface:

    GameVersion getByVersion(Game game, int version)
        throws ServerException, GameVersionNotExists;

I'll have to extract the Game key and look it up that way. I was trying to
find an example where this pattern has already been applied, but I didn't
find any. For example, I looked in UserGameProfileService and that is the
same; it has a lookup getByKey but no other more useful getters. How do you
get a UserGameProfile without knowing the database key?

In the meantime, I'll just go ahead with the GameVersion getter.

Jens -- if you are waiting on the Game view, I nearly have it, but it won't
be useful unless it has a GameVersion as well.

Follow ups