While working on the Record
based definitions, I noticed that there is a clear redundancy in the get*()
methods: they pop up in Record
, Config
, and now I also needed them in a utility class that manipulates model definition data stored in a Record
.
The solution was to add a new class called RecordAccessor
that contains nothing but these get*()
methods. This new class can then be inherited into any other class that benefits from providing native access to a Record
.
While RecordAccessor
is currently specific to Record
instances, it could still be generalized into an IAccessor
class that queries values from an abstract source where values are addressed using paths — this would make it possible to use it also with PathTree
.