Define split JSON and object repository ABCs, promote adapter methods to public CRUD, add example domain repositories, modernize interface stubs, and make the package installable for tests. Co-authored-by: Cursor <[email protected]>
24 lines
538 B
Python
24 lines
538 B
Python
"""Definition of ConnectionAwareInterface abstract base class."""
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
|
class ConnectionAwareInterface(ABC):
|
|
"""Interface that defines connection-related methods."""
|
|
|
|
@abstractmethod
|
|
def connect(self) -> None:
|
|
"""Connect to resource."""
|
|
...
|
|
|
|
@abstractmethod
|
|
def disconnect(self) -> None:
|
|
"""Disconnect from resource."""
|
|
...
|
|
|
|
@property
|
|
@abstractmethod
|
|
def is_connected(self) -> bool:
|
|
"""Check if connected to resource."""
|
|
...
|