package com.ericfeminella.rpc
{
/**
*
* Defines a Generic DAO client-side CRUD implementation which
* has been adapted from a Java typesafe AOP DAO.
*
* <p>
* DAO pattern Implementations vary considerably, users can choose
* to implement IDAO to provide a generic DAO implementation for
* maximum flexibility
* </p>
*
* <p>
* Each DAO instance is responsible for one primary domain object
* or entity.
* </p>
*
* <p>
* The DAO is responsible for performing CRUD on a domain object:
* <ul>
* <li>Create INSERT</li>
* <li>Read SELECT</li>
* <li>Update UPDATE</li>
* <li>Delete DELETE</li>
* </ul>
* </p>
*
* <p>
* The DAO may allow queries based on criteria as oppossed to just a
* primary key. These are referd to as finder methods or finders.
* </p>
*
*/
public interface IDAO
{
/**
*
* Persists a new object instance into a database
*
* @param the object in which to persist
*
*/
function create(obj:*) : void
/**
*
* Retrieves a previously persisted object using the specified
* id as primary key.
*
* <p>
* If storage is persisted as in-memory only, calls to IDAO.read();
* should return an object specific to the domain. If storage is
* persisted remotely, calls to IDAO.read(); should return null.
* The pending RPC call should handle returning the domain object
* via mx.rpc.IResponder
* </p>
*
* @param the id to be used as the primary key
*
*/
function read(id:*) : void
/**
*
* Saves changes made to a previously persistent object
*
* @param an updated persisted object
*
*/
function update(obj:*) : void
/**
*
* Removes an object from persistent storage in a database
*
* @param the id to be used as the primary key
*
*/
function Delete(id:*) : void
}
}