-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Overriding the PolarLoader to save the bytes elsewhere is surely common. But doing so is clumsy since there are now unused fields like savePath. A step of abstraction would be easy to implement and make more sense:
Two simple solutions would be:
1: Making the PolarLoader abstract and creating a FilePolarLoader and any other common ones you think would be valuable such as SqlPolarLoader.
2: Or to avoid users needing to make changes, making an interface such as ByteLoader that has two methods:
interface ByteLoader {
fun saveBytes(array: ByteArray)
fun loadBytes(): ByteArray
}is sufficient. Then just make a constructor overload for taking in a ByteLoader and implement the default ones to use:
class FileByteLoader(val saveFile: Path) {
// etc
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels