You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BoolType supports a public factory-method get() and implements a fly-weight pattern, which seems to imply you could use this to generate a custom BoolType instance, on the fly, for a specific column.
That doesn't work in practice - the column factory-methods in Table only accept a class-name string, which means that all types must be registered up front.
Perhaps that's not a bad thing - explicitly defining types up front has the expected performance characteristics and avoids implementing a fly-weight pattern and/or manually registering types under some other name besides the class-name.
Suggestion:
Remove get get() factory-method, and make the BoolType constructor public.
Keep the default true, false arguments as-is.
This will make it easy to extend BoolType into a custom BoolType, which is in fact already possible with e.g.:
BoolType
supports a public factory-methodget()
and implements a fly-weight pattern, which seems to imply you could use this to generate a customBoolType
instance, on the fly, for a specific column.That doesn't work in practice - the column factory-methods in
Table
only accept a class-namestring
, which means that all types must be registered up front.Perhaps that's not a bad thing - explicitly defining types up front has the expected performance characteristics and avoids implementing a fly-weight pattern and/or manually registering types under some other name besides the class-name.
Suggestion:
Remove get
get()
factory-method, and make theBoolType
constructorpublic
.Keep the default
true
,false
arguments as-is.This will make it easy to extend
BoolType
into a customBoolType
, which is in fact already possible with e.g.:Lets remove the confusing/misleading factory-method though.
The text was updated successfully, but these errors were encountered: