From: Mathieu Bouchard Date: 2001-05-19T10:41:31+09:00 Subject: [ruby-talk:15385] Re: Some help on naming please On Mon, 14 May 2001, J J wrote: > I'm not sure exactly what you're looking for, but here's a guess: > > here is a proposal: > > ArrayMixin -> HollowArray > > ArrayInterface -> MicroArrayI > > ArrayContract -> MicroArrayC > I don't think that's a good idea. Something else to remember, 'I' could also > be Integer, 'C' could be Class or Constant, etc. I wouldn't think so, because "Interface" here is as a suffix, and Integer, AFAIK, is not likely to be used as a suffix. You have a better grief for "C", where Class is likely to be a suffix. Well, at least it could become likely in the future, when we become able to subclass Class freely. > > MicroArrayI is a spec for minimal arrays. > How about MinimalArray or MinimalArraySpec? Spec is not so bad, but the issue with it is that MinimalArraySpec===object looks a little weird, but then so would MinimalArrayI. MinimalArray alone may be an idea... not sure. SimpleArray wouldn't be bad either. More ideas? > >Including it in a class is like > > saying "this class should support all of these operations". > How about AbstractArray or RequiredArrayOperations? And AbstractMinimalArray, RequiredMinimalArrayOperations... those are quite long names. Those last two would be used in most places where one checks for an Array like this: raise TypeError unless Array === foo by converting to this: raise TypeError unless AbstractArray === foo and I guess this is in a lot of places, because most code supporting Array is supposed to be able to support AbstractArray. I'd like a shorter name. > >MicroArrayC is > > a boosted version of MicroArrayI: it actually verifies how operations are > > used and how they are performed. > MicroArrayC = SafeArray, CheckedArray, VerifyingArray, etc. > MicroArrayI = FastArray, UncheckedArray, NonVerifyingArray, etc. FastArray is really not a good idea because the Contract includes the Interface... so every SafeArray is a FastArray too. =) In general: the Interface name is going to be written in a lot of places; the contract name can be longer because it will only be written in implementor classes. Could "Protocol" be a better name than "Interface" ? It could be: ArrayP ArrayP::Contract or ArrayP ArrayP::Assertions matju