I'm trying to write small application in GAE. I'm using Java and native DatastoreService to handle data (Objectify is a possibility but it does not change much).
I'm having hard time figure out how to keep object oriented design and use the data store efficiently and in transactional way.
I'm trying to build a game so I have rooms, monsters, players, etc each as a class. When the player do an action like moving or attacking I have to load some of the data, modify it and store it all in one tx so no anomalies will occur.
Should I pass a DatastoreService instance all the way down the call hierarchy or is it better to just get the DatastoreService on each class? Because the datastore ensure consistent view after I start a transaction and put an Entity when I do get I get null because i'm still in the tx, how should I handle that?
Thank you, Ido.