View Single Post
02-23-17, 11:56 AM   #11
kurapica.igas
A Chromatic Dragonspawn
Join Date: Aug 2011
Posts: 152
Originally Posted by Ketho View Post
Can you explain why you want to use OOP for addon development?

I remember this thread about it
https://forums.wowace.com/showthread.php?t=20400
The OOP is almost everywhere, using CreateFrame to create a frame, then use frame:SetSize(100, 200) is also an OOP style code.

Use ace like LibStub("AceAddon-3.0"):NewAddon(name), it's no diff to Scorpio("MyTestAddon").

So, using the OOP for addon development is not the problem. From the 7.0, the Mixin system also is an OOP system, it has multi-inheritance and stackable event handlers, but it's too complex and require the XML system.

Take the AdventureMap_CombatAllyMissionPinTemplate as example :

XML Code:
  1. <Frame name="AdventureMap_CombatAllyMissionPinTemplate" enableMouse="true" mixin="AdventureMap_CombatAllyMissionPinMixin" virtual="true">
Lua Code:
  1. AdventureMap_CombatAllyMissionPinMixin = CreateFromMixins(MapCanvasPinMixin,AdventureMap_MissionPinMixin);

In my system, it'd be defined like :

Lua Code:
  1. class "MapCanvasPin" { Frame }
  2. class "AdventureMap_MissionPin" { MapCanvasPin }
  3. class "AdventureMap_CombatAllyMissionPin" { AdventureMap_MissionPin }

It'd be more clearly for their definitions.
  Reply With Quote