On Thursday, November 22, 2012 6:17:22 AM UTC+1, Andy King wrote:
>
> I have started to create another example/tutorial, this time using MySQL 
> for the data (the first example just held the data in memory).  The example 
> has some way to go before it is complete, but it may help others even in 
> its current state.  The first part of the tutorial includes instructions 
> for pulling the code from Google Code and for creating the database table. 
>  Here's the link to the first part: GWT Request Factory & 
> MySQL<http://greatlogic.com/?p=223>. 
>  If you didn't go through the first tutorial, which is here: A GWT 
> Request Factory Journey <http://greatlogic.com/?p=33>, then that may be a 
> good idea to do first.


Your example would be much more helpful if it used JPA or JDO instead of 
your own GLBase project. Things you'll run into by rolling your own 
low-level solution include:

   - you'll have to roll your own request-scoped entity cache: RF expects 
   that a given entity is represented by the exact same instance for the 
   duration of a request (e.g. you save a book from the client and retrieve 
   the list of books in the same batch –RequestContext–, the book that has 
   just been saved should be in the list retrieved afterwards, the same 
   instance, not a new instance representing the same entity)
   - to benefit from "saving only the bits that have changed", you'd like 
   to track those changes within the entity
   - implementing Locator#isLive correctly (and without too much overhead) 
   requires doing some book-keeping (either mark entities as deleted when you 
   delete them, or evict them from the entity cache when you delete them)

All of the above are taken care of by JPA or JDO transparently, provided 
you use the "open session in view" pattern.

Not that you *should* use JPA or JDO in your apps (honestly, they always 
caused me headaches), but for a tutorial i think you should start with 
them, then possibly do another one with a low-level solution. I did write 
an RF-based app using MongoDB as the backend and had to implement the 
above-mentionned entity cache, it's relatively easy but that's one more 
distraction from a newcomer's POV.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/ZueRn73NQ3oJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to