What I learned from this project:
- Use UiBinder! It saves lots of time and speed up your website!
- Use HTML as much as you can. Don't reply too much on widget because it can cause slowness on your site.
- Usage of PersistenceManager and Datastore.
- PersistenceManager can only fetch what exist in the data; so, it will throw an errors if you try to fetch something that is not existed in datastore. Thus, to check whether an object exist in datastore or not, you can use transaction with datastoreservice API instead.
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Transaction tnx = datastore.beginTransaction();
try{
//first param is your ENTITY, second is the value of your ID/Name
Key userKey = KeyFactory.createKey("User", username);
datastore.get(userKey);
//If found then do some query/task with your PersistenceManager or DataStore here
//Don't forget to commit :)
txn.commit();
}catch(EntityNotFound ex){
//not found codes go here!
}finally{
if(tnx.isActive())
tnx.rollBack()
}- Cookies won't work when you try to use it on serverside. It will give you URI encoding errors when you try to call it over RPC. Yup, took me 2 hours to figure out -_- COOKIES = CLIENT SIDE!!!!!
- I also learned how to use ClientBundle but never tested it out with this project so maybe the next one :)
No comments:
Post a Comment