|
From: <bc...@wo...> - 2002-01-07 20:23:05
|
Hi, With the introduction of iterators, there is no longer a driving need to have a collection proxy for each PyInstance. We could instead have a static collection of the (5 to 7) different supported CollectionProxies, and the right CollectionProxy is found whenever the __len__ and __XXXitem__ methods is called. Pros: - We will save a pointer for each instance of PyInstance and PyJavaInstance and an instance of a CollectionProxy for each Vector, Hashtable, Map, etc. Cons: - A serie of instanceof operations is necessary every time one of the sequence method is called on a java instance. - It would not be possible to index a java.util.Enumerations and a java.util.Iterator (but will still be possible to iterator over them). Any thoughs? regards, finn |