View Single Post
08-27-14, 09:58 AM   #26
Sharparam
A Flamescale Wyrmkin
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 102
Again, this is related to the scale of an addon. For small addons with just a file then yes, it's very convoluted and unnecessary, but for larger projects it can be helpful to simply add event handlers whereever and not have to bother with anything other than the handler function.

The same way it's possible to add LDB/minimap icon functionality yourself but most people use the libraries as an abstraction. It's a bit off topic though.

It's possible WoW's Frame object doesn't have many fields that would typically collide with addons, but it's still striking me as a bad pattern/habit to hack your own stuff into it when Blizzard already provides every file with a private table made for the very exact purpose of sharing stuff between files. See also defensive programming.

I'm also not really seeing what the benefit is of "injecting" into a Frame object, lower memory usage from not creating a second table? But the difference must in that case be negligible.
  Reply With Quote