The December Project (The Grand Refactoring and The License)
Earlier this week I got a good/bad email from my HR department informing me that I needed to take X hours of vacation between now and the end of the year, or I would lose it.
This means that starting tomorrow (Dec2), I am now forced to take Thursdays and Fridays off. No doubt this will cause friction at home because now I will want to monopolize the computer for my own purposes.
So starting tomorrow, I will begin the changes to start putting the common bits of code in all the Guide addons (Leveling, Event, Dailies, Professions) into the base addon.
I'll do it a function/variable at a time, quest a bit and then move on. The basic idea is simple.
- WoWPro will become a "Library" which will support the "Embed" method
- Every function and method to be exported will be registered with WoWPro:Export("function"), which will add it to a list
- The Guide addons will call the WoWPro:Embed(WowPro_XXX) method at the start of loading, which will add all the "standard" methods and functions. The addon is free to redefine anything it wants to override.
That is it! Once this exercise is complete, we will be left with much less code in the addons. We can then work at migrating the leftover goodies in the guide addons back into the base addon to make functionality even across the guides.
Now, along the way, I may change the way some things work. Right now, for instance, the guide list code is bollixed up because each addon implements its own tab and tab management functions that do not have the right information at initialization time to do the right thing. I'll rewrite that code to make it data driven and provide functions in WowPro: for the addons to register functions to return the number of guides, the number of columns and the column labels and to provide a call back when the user selects a row. All of the window handling logic will be centralized and the guide specific information kept out of the core addon.
Oh, and as I go along, I will start adding copyright notices to all the files. This has been discussed on and off now for nearly a year and now we have settled on a bit of a compromise. We have opted to not try to write one of our own licenses (that way there be dragons), but to use a customizable license: the Creative Commons License.
What does it boil down to:
- Under this license, users can redistribute the code, which we are not thrilled about, but is a minor annoyance.They would have to attribute the code to us (the WoW-Pro Community) and link back to our web site.
- Users can't use the code commercially.
- Users can't redistribute the code if they modify it (so our competitors can't take it and change a couple things and redistribute it).
The advantage of this license is that it's well recognized and has an infrastructure in place which explains decently.