On 7 June 2017 at 21:34, Sam Ruby <[email protected]> wrote: > On Wed, Jun 7, 2017 at 3:34 PM, sebb <[email protected]> wrote: >> cttee1 = ASF::Committee.preload >> cttee2 = ASF::Committee.load_committee_info >> >> cttee1 gets the LDAP committee info >> >> cttee2 gets info from committee-info.txt >> >> I find this rather confusing, and it seems to me that it is >> error-prone and a bit of a maintenance headache, because the Committee >> class is now defined in multiple files. If the same method name is >> defined in two classes, which one will be used? I suspect it will >> depend on the order the files are loaded. >> >> Similar considerations apply to the Person class > > I'm not sure I understand this comment. In particular, do you have an > example where the same method name is defined for the same class in > two different files?
AFAIK there are no clashes - yet. However if there is a need to add a new method to one of the classes, one has to check if the name has already been used in one of the other class definitions. And it makes code re-organisation harder. For example, 'load_committee_info' performs much the same function as the 'preload' methods in other classes. For consistency one might consider renaming it as 'preload' ... It's also very confusing having the same class name for LDAP commitee group info and PMC info derived from CI.txt etc. This is less of an issue for the Person class does appear to describe a single type of entity. > Meanwhile, classes list ASF::Commitee and ASF::Person are constructed > from various sources. Yes, and again there is the potential issue of different sources accidentally defining the same method or field with a different meaning. The Person class is currently defined in 8 source files. A maintenance headache. > But one thing you can count on: if you find a > given person or committee or whatever, and still have a handle for > that object, and try to find it again, you will get the same object. That is interesting but tangential to this thread.
