Lukas Renggli wrote:
Also most
access strategies seem to be useless to me. I only use the
NullAccessor (used internally), the ContainerAccessor (used
internally), the SelectorAccessor, and rarely the
AutoSelectorAccessor. Time for a clean-up?
I think the ChainAccessor strategy is also very useful
Agree, but I found myself to prefer helper methods. For example
instead of specifying #(group name) using a ChainAccessor, I just
implemented User>>#groupName that delegates to the group and then use
the SelectorAccessor. There are certainly cases where the
ChainAccessor is simpler to use.
Lukas
I use MAChainAccessor as a fundamental piece in my RDB mapping.
I walk the descriptions, including OneToOne relations and build a
mapping from a flat db response into the described object model. As I
build the query I collect the accessors for writing the query results
into the model.
While doing this I treat the Chain accessors like a stack that you can
push and pop onto. I add MAAccessor-chainTo: for pushing and
chainUnlinkLast for popping with #isChainAccessor for testing along the way.
I have used MADictionaryAccessor for accessing settings but ended up
defining a first class object for this.
I use BlockAccessor for situations where the DB is not quite mapping
directly into the to/from the model
Now I have DummyAccessor, which works very well, since I only have to
define #defaultAccessor - I have a table component where I select the
content and order of fields for columns. However I also define buttons
and spacers with descriptions even though they have no values, they can
be selected and ordered together with real value accessing items.
So I am not sure there is much left to tidy up....
Keith