ProgramixGenericLib v5.0.1

com.programix.da
Interface DataAccess


public interface DataAccess

Used to implementation the very useful "Data Access Layer" abstraction.

This interface is extended to provide a useful collection of methods. Each method should perform a 'unit of work'. Each method should declare that it throws DataAccessException to indicate an underlying problem (such as an IOException, SQLException, etc. Application-specific exceptions can be thrown in addition to DataAccessException.

DataAccessFactory has many create methods to automate the task of instantiating and initializing an instance.

NOTE: all implementations must have a public zero-argument constructor.

Author:
Paul Hyde

Method Summary
 void close()
          Called to 'shutdown' the instance.
 void init(ValueMap config)
          Called once just after construction to allow the implementation to setup everything required to run.
 

Method Detail

init

void init(ValueMap config)
          throws DataAccessException
Called once just after construction to allow the implementation to setup everything required to run. This method is called before any other methods on this interface. If this method returns without throwing an exception, access to the other methods is opened up.

Parameters:
config - all the settings needed to complete initialization
Throws:
DataAccessException - if initialization could not complete, possibly chained to an underlying cause.

close

void close()
Called to 'shutdown' the instance. No other methods should be called after this method. Calling other methods after calling this method results in undefined behavior. Calling close() more than once must be allowed and close() does not complain. Also note that close() never throws any exceptions—it just makes its best effort of close down everything.


ProgramixGenericLib v5.0.1

Copyright © 2001-2009 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.