Open Registry of Game Information 

  • Proposal: Relations Between Games

  • Talk about specific features of our upcoming online game database.
Talk about specific features of our upcoming online game database.

Moderators: MZ per X, gene

 #37705  by Tracy Poff
 04 Dec 2013, 11:43
hydr0x wrote:I'd argue that redundancies are always bad and should only be introduced if necessary(!). O/R-Mappers have to have a concept of direction as objects do have them. They are forced to map this to the database. But, as far as I can tell from the SQLAlchemy documentation, adding backref or not to a m:n-Relation does not change anything on the database end. It certainly doesn't seem to add the redundant column in one of the data tables, but rather just creates a relation table. All backref does is add collection objects to both data classes.
Upon actually inspecting a database created by SQLAlchemy, I find that you're totally correct, here. It's been long enough since I read the SQLAlchemy docs (somewhat more than two years, I guess) that I misremembered how it works, and I was confused by something I read in Hibernate's documentation a few weeks ago, so I came to a bad conclusion about how it functioned. Mea cupla. Thanks for explaining.
hydr0x wrote:Anyways, it's pretty pointless to discuss this. A) the guys aren't yet in the implementation phase B) hibernate will force it's own idea of database design down your throat ;)

As for the Hibernate best practice, it's questioned by quite a few devs, see this discussion for an example.
Indeed, there's no need to worry about minute details of implementation at this stage. When I started this thread I just wanted to suggest using a generic format for game relations (as opposed to something like a 'sequel' property on each game) but it somehow turned into something very different.

Thanks for the link to that discussion. I think the particular situation in that answer ("one-to-very-many" and "many-to-very-many" relationships) probably will not happen for us, but it looks like that's not the only time Hibernate can have performance issues. I've learned some useful things, tonight!
 #37709  by MZ per X
 05 Dec 2013, 22:30
Tracy Poff wrote:
MZ per X wrote:But I think that game series shouldn't be handled using the game group implementation. Instead, we should implement something similar like UVL does with game relationships, as in two games being linked to each other with a relationship type like "prequel to", "sequel to", "port of", or similar.
So... I did actually have a particular problem I was trying to solve, though I may have been a bit too enthusiastic to show off how general my solution was.
Meanwhile, I also think that the entity approach for game series is the better one, because we need to save meta information like description, or links, to every series. We could use game groups for this, we just need to find a way to order the entries. But that belongs in the other thread.

Nevertheless, we will definitely need your game connection approach for other things, so it was very worthwhile thinking about it. I am convinced now that we should go for tightening our different game criteria, and do all those things like game groups, genres, etc. at game level, as far as this will be possible.
 #38195  by MZ per X
 18 Jan 2015, 22:49
MZ per X wrote:Nevertheless, we will definitely need your game connection approach for other things, so it was very worthwhile thinking about it.
At long last, I implemented game entry relationships in the data model. :)

Please add to the list, if I missed some relationships.