View Single Post
07/11/16, 02:08 PM   #11
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
Originally Posted by tgolsson View Post
I develop a lot in Java, and to give an analogy (if it makes any sense to you) what I am trying to do is create View for each group member, and then create a Controller for managing all these views. It's called the "DRY" principle: "Don't repeat yourself". It's the same thing for each group member, so I should have only one piece of logic and markup for it.
It might be worth taking a look at CyrHUD, where I do a similar approach. There instead of unit frames, it's showing information about ongoing battles in PvP. I have a view object for each displayed row (classes/Label.lua) as well as model objects for each battle (classes/Battle.lua). It's not a pure MVC model, as some of the controller logic is mixed in with the model class, with the rest in an update loop (not an object).

Also, it has a fair amount of OOP, which might be a more comfortable style if you're coming from Java.

http://git.esoui.com/?a=tree&p=CyrHUD
  Reply With Quote