Open cthulhu-rider opened 2 years ago
I'd keep it as is, simple and good enough.
Such typing does not allow internal type changes. If we will support types from neofs-api-go
within v1.x
, then we can keep it as is. Otherwise we will be locked in internal type restructuring.
Full-private struct covers all cases more user-friendly. But I don't mind leaving the current typing since docs advise avoid casting.
In current implementation some types (example) are defined as wrappers over other types:
In type docs we try to prevent direct type conversion since it can lead to compatibility loss:
Instead we provide methods to do it like:
If we'll later change type definition to:
direct conversion will be broken, while method won't.
Maybe we want to prevent type conversion by hard encapsulation and define all such type as
struct
with private fields?I also suggest to comprehensively explore the difference between the two approaches, and generally accepted practices.