Deprecate Uuid#setFactory()
, use dedicated factories for FieldInterface
and for UUID creation
#326
Labels
Uuid#setFactory()
, use dedicated factories for FieldInterface
and for UUID creation
#326
Problem-space
While working on #324, it became evident that the majority of complexity within this library comes from
Uuid#setFactory()
, which completely switches the behavior of the (supposedly)@psalm-pure
operations, as well as the variousUuid::uuid1()
throughUuid::uuid6()
methods.Solution
I suggest deprecating and discouraging usage of
Uuid#setFactory()
andUuid#getFactory()
, as well as deprecating all setters onUuidFactory
itself, so that post-instantiation no internals of it can change.After that, we can drop all this API for
5.0.0
, allowing for major performance and design improvements within the core of the library.Further scope
UuidFactoryInterface
also needs to be split up a bit: there is no need for instantiating specific UUID sub-types unless the user relies on them, so I'd suggest having dedicated API for that, and dedicated API for retrievingFieldsInterface
.FeatureSet
is also extremely bloated: while flexible, it leads to a lot of added complexity for supporting things like GUIDs, while separate independentUuidFactoryInterface
concrete implementations would be better for both clarity and runtime performance.The text was updated successfully, but these errors were encountered: