MANullAccessor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

MANullAccessor

keith1y
Does MANullAccessor have to be so so... erm unusable?

If you happen to use it nothing seems to work with it.

i.e. accessor selector doesnt work, one should argue that it shouldnt,
but is it doing a good job of being a null?

Most users of read: dont test canRead: first.

I am thinking of implementing a subclass MADummyAccessor which does
implement read: just so as it can play with the other accessors in
mementos etc.

I just wondered if there was a case for making MANullAccessor more
friendly, i.e. swap its behaviour from pessimistic to optimistic, rather
than expecting all users to test canRead: first, expect those users that
really care to test cantRead:

just an idea

Keith

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MANullAccessor

Lukas Renggli-2
> Does MANullAccessor have to be so so... erm unusable?

One important thing to notice is that the accessors are also used to  
establish identity between descriptions. In case of the NullAccessor  
this is done trough an UUID, in case of the SelectorAccessor this is  
naturally done trough its selector.

> If you happen to use it nothing seems to work with it.
>
> i.e. accessor selector doesnt work, one should argue that it shouldnt,
> but is it doing a good job of being a null?

Since the NullAccessor is the default, it is supposed to warn the  
user of a missing access strategy. In case descriptions are created  
by end-users (where something like an access strategy would be out of  
scope), the NullAccessor establishes a perfect identity, that can  
then be used in #readUsing: and #write:using: to dispatch the access  
for example to a dictionary.

> Most users of read: dont test canRead: first.

I wonder if #canRead: and #canWrite: are still needed? 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 am thinking of implementing a subclass MADummyAccessor which does
> implement read: just so as it can play with the other accessors in
> mementos etc.

That would make sense in your case, I guess.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki