Towards the end of 0.6 it was discovered that there were issues with certain Item subclass constructor signatures not working well with the repository and/or schema APIs. To address this, Andi changed the base Item constructor signature to use parameter names consistent with the resulting Item's attribute names. That is, the constructor signature is:

    Item(itsName, itsParent, itsKind)

I also undertook a lot of refactoring to get rid of Item subclass __init__ methods throughout the OSAF parcels, in order to prep for making this change complete. However, there were a few modules with complex __init__ methods, and rather than destabilize we decided to wait until the 0.7 timeframe to finish this cleanup.

I've almost finished that cleanup now, but there are some issues. One of the reasons for making the change is that there are a *lot* of things with 'name', 'parent', or 'kind' attributes or keywords that are not an item's repository name, parent, or kind. For example, some collections have a 'kind' attribute which is not the same as the collection's 'itsKind' attribute, if you see what I mean.

Unfortunately, through 0.6 these both had the same parameter name, so there is some possibility that I've messed up the conversion in some areas that the test suites don't cover. After I did the initial round of conversion using unit tests as a basis, I did some greps and found that there was an awful lot of unconverted calls, that couldn't have worked and therefore must not be being invoked by our unit tests. So, I've made some effort to update the code that's not covered by tests, but of course it's hard to confirm whether I might also have broken anything else.

Anyway, I'd like to suggest that we establish a convention of using parameters named 'itsName', 'itsParent', 'itsKind', and 'itsView' *ONLY* for calls to routines that create items or set that attribute of an item, and never use them as attributes of objects other than repository Items.

I'd also like to suggest that we *NEVER* use 'view' as a parameter or attribute name when it's a repository view, instead using 'rv' or 'repoView'. This will be especially important if we start to have other kinds of views in 0.7 (e.g. of the MVC or MVP variety). I haven't actually started implementing this yet, as I want to get the other changes wrapped and checked in first.

Comments?  Questions?

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

Reply via email to