8.5. Using custom Locators and ServiceLocators (the “long way”)

Let’s recap some important points before we move forward. First, in section 8.3.3 we provided a list of the Contact Locator methods that had to be contained within your domain class. These were a no-arg constructor, a static findContact(id) method, a getId() method, and a getVersion() method. In addition we also created several service methods to the domain class that implemented our server-side functionality. These service methods include count(), persist(), and remove(). In this section we’ll move both sets of methods out of our domain class.

You may have a lot of valid reasons for wanting to do this. Perhaps your class can’t have a no-arg constructor, perhaps you don’t have ...

Get GWT in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.