Okay,
First, I'm bringing this to the list; because we have some things to decide.
The case sensitivity flag was either a bad idea or somewhere it got lost
in the usage.
Questions & Discussion Points:
-----------------------------------------
(a) When building the dictionary, usually if we have case-sensitivity
set to false entries really only need to be added once if they are
already not there. 'a' and 'A' in a case-insensitive dictionary are
really the same and only one will match. If we impose this assumption
then we really need the false setting to mean that we will always
compare without regard to case even if we are comparing to an entry that
wants case sensitivity and is set to true.
(b) When using the dictionary, since the caseSensitivity flag is not
final, the dictionary default can be changed for new entries ONLY, the
change here doesn't affect already added items to the dictionary. This
is both a good and bad thing. Good in that we could change the default
for the comparisons, bad in that if we allow the change the dictionary
could be modified to add new entries with the flag not set to the
creation setting. It isn't a problem now; but, if we allow the user to
change the flag without forcing it at creation; we could end up with issues.
(c) Coming to usage. The change I talked about for the isCaseSensitive
test for the other entry doesn't really make sense since the dictionary
object itself will create a new string list with a caseSensitive flag
for the dictionary. There really isn't any way to change this without
creating a new dictionary with the flag set to true/false.
(d) The case-sensitivity setting needs to be saved with the dictionary
to the file. This is one place where we really need to be careful.
I've looked somewhat at the problem and unfortunately, there isn't an
easy fix. Saving is okay, it is getting the setting from the file...
reason being is that due to the way some of it works, we could append
dictionaries causing a mixed case-sensitivity setting. Really bad news;
since, the dictionary has one flag and each entry has another copy of
the flag for the StringListWrapper class. Another way would be adding
the settings to the properties for the model and saving the dictionary
inside the model as well.
I'm open for ideas and the like.... even entertain the option of
re-writing the Dictionary .... even if it ends up being just a
DictionaryInterface.
James