From: Rony G. F. <Ron...@wu...> - 2007-05-27 22:44:18
|
Hi there, while looking at the possibilities that sort allows for I stumbled over a few observations which I think are omissions. Not being sure I rather list them here, but would enter them as bugs (please note that at the moment I cannot create ooRexx, hence I do not want to check in anything that I cannot test): * "CaselessColumnComparator", "ColumnComparator" and "InvertingComparator" should mixinclass "Comparator" instead of "Object", * the "Descending*Comparator" classes *could* be removed, as using "InvertingComparator" would allow for that; if you want to keep them (perhaps making it easier for the programmers to sort descendingly), then I would suggest that "DescendingCaselessComparator" is mixinclassing "DescendingComparator" (to match "CaselessComparator" which mixinclasses "Comparator"), * in the "*ColumnComparator" I noticed that the "length" argument is mandatory: shouldn't that remain optional, in which case the remainder of the string is taken for comparison purposes? Also, while at it, how about enhancing it such that multiple columns could/can be compared? So this would probably mean that: * class "ColumnComparator": o method "compare" */is missing/* o should mixinclass "Comparator" * class "CaselessColumnComparator": o should mixinclass "Comparator" * class "InvertingComparator": o in method "compare": "*/USE STRICT ARG left, right/*" */is missing/* o should mixinclass "Comparator" To be able to fully use the classification tree for classifying purposes, the classes "Comparator" and "DescendingComparator" should both have either the same parent, or "DescendingComparator" should specialize "Comparator" or both classes should be marked with a class that indicates "comparator" functionality. (An alternative could be to use a package concept, where one would be able to classify by putting classes belonging together into the same package; but then one would need an ability to check whether a class got defined to belong to a certain package.) Regards, ---rony |