So I always need three information Class * method * extended|defined
Not quite.
At this moment, for any given class in a package, you can either have entries in the defined or in the extension dictionaries, but not in both in the same time. So, this is an indication that you can simply merge the two dictionaries.
sure but you have them to filter after.
As soon as you add a method to a package, you know exactly if that method is defined or not by knowing whether the class is defined in that package.
Yes this was the first implementation I did and it was boring to always check. Is the class defined or not.
Also, if you do have the methods in one dictionary, then you also won't have to care whether you moved the definition of a class between packages.
Ummm I do not buy that. How?
Right now, if you move the definition of a class without touching the methods, you will have to ensure in the two packages that the methods that were defined are not extensions and the other way around.
yes.
If you interpret the extension by looking at where the class is defined, then you do not lose anything.
speed? Indeed I could merge all the methods into two dictionaries instead of four and always check the classes defined in the packages. but I will be doing includes: all the time. I can give a try. May be I will do another implementation to be able to measure. I will first remove the isExtension:
Yet another point is that I typically first want to know the methods of a class from a package. I do not want to know which is extended or which is not. So, I currently have to look it up in two dictionaries which is not necessarily optimal.
you have the method methodForClass: for that, you get all the methods defined or extended for a class in a given package.
Or am I missing something?