1 package com.panogenesis.service;
2
3 import java.io.Serializable;
4 import java.util.List;
5
6 import com.panogenesis.dao.DAO;
7
8 public interface Manager {
9
10 /***
11 * Expose the setDAO method for testing purposes
12 * @param dao
13 */
14 public void setDAO(DAO dao);
15
16 /***
17 * Generic method used to get a all objects of a particular type.
18 * @param clazz the type of objects
19 * @return List of populated objects
20 */
21 public List getObjects(Class clazz);
22
23 /***
24 * Generic method to get an object based on class and identifier.
25 *
26 * @param clazz model class to lookup
27 * @param id the identifier (primary key) of the class
28 * @return a populated object
29 * @see org.springframework.orm.ObjectRetrievalFailureException
30 */
31 public Object getObject(Class clazz, Serializable id);
32
33 /***
34 * Generic method to save an object.
35 * @param o the object to save
36 */
37 public void saveObject(Object o);
38
39 /***
40 * Generic method to delete an object based on class and id
41 * @param clazz model class to lookup
42 * @param id the identifier of the class
43 */
44 public void removeObject(Class clazz, Serializable id);
45 }