Tuesday, January 6, 2026

Library, “Injecting factory” and best practices for extending a library

I use a library which I need to patch. I need to fork it because Factory design patter is not used.

Library has that structure: class X that hold references to other classes, that hold references to other classes and few more layers. Class hierarchy is “tree-like” structure.

I look for best way for refactoring – flexible enough to prevent people forking it. I cannot find any best practices on that problem.

Over years I use to solve it by “Injecting Factory” – Factory pattern where parent object is being injected (DI) in factory method. I cannot find any documentation on such approach and I need some feedback on it (e.g. theory or possible problems).

I describe it with an example with Car:

Thursday, January 1, 2026

Clover boot loader cannot boot from NVMe / PCIe disk - solved

Clover boot loader software could not find your NVMe partitions because it comes with no NVMe driver.

The solutions of the issue is easy - you should just download that driver (it's universal NVMe driver) and copy it to Clover boot partition in a specific directory.