Book Image

Google App Engine Java and GWT Application Development

By : Daniel Guermeur, Amy Unruh
Book Image

Google App Engine Java and GWT Application Development

By: Daniel Guermeur, Amy Unruh

Overview of this book

<p>Google Application Engine is a cloud computing technology that lets you run web applications that are easy to build and maintain as well as being scaled and load-balanced automatically. To build interesting and interactive web applications developers are turning to Java. However, building and deploying scalable web applications using Google Web Toolkit and Google App Engine for Java can be challenging even to developers. The start to finish approach of this book helps you meet these challenges.<br /><br />This book is designed to give developers all the information they need to develop their own GAE+GWT applications, with a particular focus on some of the technologies useful for building scalable social-media-oriented applications. It is an easy-to-follow guide that shows you how to get the most out of combining the powerful features of GAE and GWT. It provides you with solutions to many of the problems that arise in developing, maintaining, and scaling web applications.<br /><br />The book introduces you to the features of Google App Engine (GAE) and the Google Web Toolkit (GWT) to help you build interesting and interactive real-world AJAX applications. Over the course of the book, you are guided by the development of a sample application using the Google Web Toolkit (GWT) plugin for Eclipse. To make things easier for you, all application building blocks are explained in detail, walking you through the development process step by step.<br /><br />The book teaches you the key technologies and methodologies that can be applied to developing your application locally, enhancing your application functionality and accelerating performance, integrating your application with Google Accounts, Facebook, and Twitter as well as monitoring and maintaining your web application.</p> <p>Packed with great examples and clear explanations, you will be able to build your own web applications that are scalable and reliable using GAE and GWT with Java.</p>
Table of Contents (19 chapters)
Google App Engine Java and GWT Application Development
Credits
About the Authors
About the Reviewers
Preface
Index

Supporting synchronous content delivery: Datastore queries and caching


In addition to the asynchronously run background jobs, new methods are required to synchronously deliver stream content to the client on request. As introduced previously, the client might request content for all Friends of the user or only a selected subset. These methods reside in the server.MessagesServiceImpl class, which extends RemoteServiceServlet. This class ties together the use of a number of Datastore and cache-related design considerations and query constructions that we have introduced in previous chapters.

The MessagesServiceImpl class methods support the various modes in which the client might request activity StreamItems, for example, "give me the items since last request", "give me the most recent N items", or "give me the N items older than this date".

@RemoteServiceRelativePath("messagesService")
public interface MessagesService extends RemoteService {
  List<StreamItemSummaryDTO>
    getNLastMessages...