SQLair has an internal package, but under that a single expr package into which everything is lumped.
This has allowed accretion of logic with no clear delineation of concerns, lack of encapsulation, no principle of least knowledge et al.
Here we create a new package typeinfo into which logic around reflection and type information is relocated. In particular:
The exposed API surface of this logic is now apparent.
typeinfo.Member (previously typeMember) implementations assume responsibility for returning their corresponding values within parents, and for generating scan targets. This fixes query and prepare logic so that we can rely on the indirection and eschew type switching, which violates responsibility bounds.
SQLair has an
internal
package, but under that a singleexpr
package into which everything is lumped.This has allowed accretion of logic with no clear delineation of concerns, lack of encapsulation, no principle of least knowledge et al.
Here we create a new package
typeinfo
into which logic around reflection and type information is relocated. In particular:typeinfo.Member
(previouslytypeMember
) implementations assume responsibility for returning their corresponding values within parents, and for generating scan targets. This fixes query and prepare logic so that we can rely on the indirection and eschew type switching, which violates responsibility bounds.