Skip to content

Directly support changing how Bytes are stored. #68

Open
@m4xy

Description

@m4xy

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions