From: Doug C. <de...@fl...> - 2002-02-22 22:25:17
|
Please compare your Map.SetProxy with my SortedSet.SubSet implementations (and the corresponding differences in your PeriststentCollection.IteratorProxy and my SortedSet.WrapIterator). I felt squeamish about having a null session in the SubSet (and I'm not sure if I need to handle getInitialValue and setSession in the SubSet -- I assume not, since the SubSet is already materialized and the session has no handle on it). But the advantage of my approach is much more code sharing between SubSet and SortedSet (and Set). This will be even more pronounced in the SortedMap implementation -- so I'll hold off on implementing that until I get your guidance on the direction to take. An alternative compromise between the two approaches is to add an instance variable to SortedSet, backingSet, which would be null for the real set, and for subsets it would reference the SortedSet superset. Then write() and read() could check backingSet: if it's null they would do the usual thing, if not they would delegate. This would be compatable with PeristentCollection.IteratorProxy I think. e |