Thread Tools Display Modes
08-23-17, 03:36 PM   #1
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Uploaded a new library for object-oriented lua programming

In my current UI pack (MayronUI Gen5), I am using a system for creating classes and encapsulating private data for instances of classes. I wanted to create a more powerful library to replace this and add a ton of new features.

In the future, I will add more classes that provide useful functionality, which can be imported using the library. I have currently made a simple List and Map object (similar to Java), but I want to add more common classes in the future, such as event handling features, etc...

About LibObjectLua
  • LibObject is a framework intended on making object-oriented programming easier for Lua developers.
  • You can create classes and call them to instantiate new instances/objects modeled from those classes.
  • You can create interfaces that enforce functions to be implemented by classes.
  • You can enforce strict typing rules to class and interface function parameters and return values.
  • Each class can inherit from at most one parent class. All classes either directly, or indirectly, inherit from the Object class.
  • There are many useful Object functions that all classes inherit and can use.
  • You can export/import classes using packages within a namespace.
  • There are many classes that can be imported from the framework, including a collections framework (similar to Java).
  • And more...

For the full documentation: http://www.wowinterface.com/download...LibObject.html

All feedback is appreciated

Last edited by Mayron : 08-24-17 at 12:15 AM.
  Reply With Quote
08-23-17, 09:49 PM   #2
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Looks... interesting. I want to say there is an old library with the same name on Curse just to avoid any confusion with that one
https://wow.curseforge.com/projects/libobject
  Reply With Quote
08-23-17, 11:48 PM   #3
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Originally Posted by Ketho View Post
Looks... interesting. I want to say there is an old library with the same name on Curse just to avoid any confusion with that one
https://wow.curseforge.com/projects/libobject
Thank you for pointing that out. I'll try to think of another name ><

EDIT: Renamed to LibObjectLua

Last edited by Mayron : 08-24-17 at 12:15 AM.
  Reply With Quote
08-27-17, 04:47 AM   #4
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Updated to version 2.0. The new version includes:
  • Package exporting and importing
  • An Object:Parent() function so that you can choose to run Parent functions from child instances, instead of the child overridden version of the parent function.
  • Strict typing for widgets and objects, so you can validate whether a parameter or return value type is an instance of a class/interface, or a specific widget, such as a "Frame".

I have also edited the library documentation to support these new changes.
  Reply With Quote
08-28-17, 04:56 AM   #5
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
First of all, thank you for sharing your project

I found a simple typo while I was reading your project page.

For section 4 (Function Definitions), there's a line saying

"Line 9 states that the first argument passed..."
which I guess it should be Line 10, not 9.

It won't confuse any readers even if you don't fix it, but you know

Last edited by Layback_ : 08-28-17 at 05:01 AM.
  Reply With Quote
08-28-17, 07:36 AM   #6
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Thanks for pointing that out. I recently altered the code examples and only managed to find a few line number notes that needed changing.

I also added text emphasizing that strict typing of parameter and return values is completely optional and you do not have to enable this feature.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Uploaded a new library for object-oriented lua programming

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off