Interface DataAcc

All Known Implementing Classes:
DataHub

public interface DataAcc
An interface designed for implementing data access operations through default methods in its sub-interfaces.

Sub-interfaces of DataAcc are expected to define and implement data access methods as default methods. Within these default methods, the connection to the underlying data store should be obtained using the getDataConn(String, Class) method provided by this interface. This design promotes a clear separation of concerns, allowing data access logic to be encapsulated within the interface itself.

  • Method Summary

    Modifier and Type
    Method
    Description
    <C extends DataConn>
    C
    getDataConn(String name, Class<C> cls)
    Retrieves a connection to a data store.
  • Method Details

    • getDataConn

      <C extends DataConn> C getDataConn(String name, Class<C> cls) throws com.github.sttk.errs.Exc
      Retrieves a connection to a data store. This method is intended to be used by default methods in sub-interfaces to obtain the necessary connection for performing data access operations.
      Type Parameters:
      C - The type of the data connection, which must extend DataConn.
      Parameters:
      name - The name identifying the specific data connection to retrieve.
      cls - The Class object representing the type of the desired data connection.
      Returns:
      A data connection object of the specified type.
      Throws:
      com.github.sttk.errs.Exc - if an error occurs while obtaining the data connection.