Created
October 23, 2009 00:30
-
-
Save mraible/216495 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.appfuse.gwt.client.service; | |
import java.io.Serializable; | |
/** | |
* Generic Services to allow easily creating GWT services. | |
* | |
* @author mraible | |
* @param <T> a type variable | |
* @param <PK> the primary key for that type | |
*/ | |
public interface GenericService<T, PK extends Serializable> { | |
/** | |
* Generic method used to get all objects of a particular type. This | |
* is the same as lookup up all rows in a table. | |
*/ | |
void getAll(); | |
/** | |
* Generic method to get an object based on identifier. | |
* | |
* @param id the identifier (primary key) of the object to get | |
*/ | |
void get(PK id); | |
/** | |
* Generic method to save an object - handles both update and insert. | |
* @param object the object to save | |
*/ | |
void save(T object); | |
/** | |
* Generic method to delete an object based on id | |
* @param id the identifier (primary key) of the object to delete | |
*/ | |
void delete(PK id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment