News for hackers. Stuff that matters.
Re:A Database Model for Simple Board Games by lewisl9029 on Friday March 11, 2016 @03:06PM (#11269126)
I personally prefer a more data-oriented approach to modeling, as opposed to modeling in terms of objects and relations. One of my favorite videos from Clojure Conj last year talks about the approach in more detail and contrasts it with traditional OO modeling in the context of a board game:

https://youtu.be/Tb823aqgX_0

In summary, modeling the board game with data (state) and pure functions (state transitions) had significant benefits over the alternative OO style model in terms of the overall simplicity of the model. The OO modeling approach resulted in a model that consisted of 22 classes, 11 interfaces, 1 enum, and 271 lines of boilerplate code just to implement the classes and relationships alone, with no game logic whatsoever. On the other hand, the data-oriented approach produced an entire working implementation of the game logic in 144 lines using 31 functions (small and highly composable functions, longest of which was 7 lines).

My takeaway was that modeling in the traditional OO style can be a helpful process in getting a good feel for your problem domain at a high level, but trying to immediately translate the resulting relationship model into code is not necessarily a good idea, because the classical OO relationship model is inherently highly complected, and will bring that complexity straight into your codebase if you try to translate it word-for-word. Taking the insights from your relational model and using it as a guide to help model your problem domain as data and functions usually results in a much simpler codebase, and in turn, a much more robust and predictable application.

Re:A Database Model for Simple Board Games by octagonal on Saturday March 12, 2016 @06:54AM (#11272482)
Thank you for that link, super interesting! It made me interested in trying out Clojure and seeing what it's all about.
Re:A Database Model for Simple Board Games by _lce0 on Friday March 11, 2016 @03:26PM (#11269247)
> We know which player starts first. After that, players move alternately.

During my teen ages I really enjoyed playing truco, which is a card game in which player turns are decided upon the previous hand's result.

https://en.wikipedia.org/wiki/Truco

Re:A Database Model for Simple Board Games by iblaine on Friday March 11, 2016 @01:54PM (#11268673)
The vertabelo.com spam on reddit.com/r/database can now be found on hackernews...it's a cool product and all but seriously...spam is spam...
Re:A Database Model for Simple Board Games by DanBC on Saturday March 12, 2016 @06:59AM (#11272499)
I think it's a good idea to email this kind of thing to HN.

Here vertabelo links are submitted only by one or two people; and this submitter moslty submits only vertabello links. I think that's the kind of thing dang is interested in.

(But I'm not sure).

Re:A Database Model for Simple Board Games by cthulhujr on Friday March 11, 2016 @02:04PM (#11268732)
"What's this cool database modeler? Huh, it's made by vertabelo... where have I seen that? Oh goddammit."
Re:A Database Model for Simple Board Games by jonbarker on Friday March 11, 2016 @02:43PM (#11268979)
Not interested in supporting Go? Would be great timing with the AlphaGo tournament!
Re:A Database Model for Simple Board Games by jasondc on Friday March 11, 2016 @01:50PM (#11268649)
I would love to see the document model for the same board games, compared to relational.