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 TypeMethodDescription<C extends DataConn>
CgetDataConn
(String name, Class<C> cls) Retrieves a connection to a data store.
-
Method Details
-
getDataConn
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 extendDataConn
.- Parameters:
name
- The name identifying the specific data connection to retrieve.cls
- TheClass
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.
-