23 lines
666 B
Python
23 lines
666 B
Python
class Component[T]:
|
|
'''
|
|
Component
|
|
|
|
General wrapper for storage components to be used in various database
|
|
contexts. Relations can be thought of generally as named data
|
|
containers/entities serving as a fundamental abstractions within particular
|
|
storage protocols.
|
|
'''
|
|
|
|
def __init__(self, name, obj: T) -> None:
|
|
self.name = name
|
|
self.obj = obj
|
|
|
|
def __str__(self) -> str:
|
|
return f'<Component ({self.__class__.__name__})> {self.name}'
|
|
|
|
def __repr__(self) -> str:
|
|
return f'<Component ({self.__class__.__name__})> {self.name}'
|
|
|
|
def get_attributes(self) -> dict:
|
|
raise NotImplementedError
|