WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Uploaded a new library for object-oriented lua programming (https://www.wowinterface.com/forums/showthread.php?t=55670)

Mayron 08-23-17 03:36 PM

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 :)

Ketho 08-23-17 09:49 PM

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

Mayron 08-23-17 11:48 PM

Quote:

Originally Posted by Ketho (Post 324773)
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

Mayron 08-27-17 04:47 AM

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.

Layback_ 08-28-17 04:56 AM

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

Quote:

"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 ;)

Mayron 08-28-17 07:36 AM

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.


All times are GMT -6. The time now is 07:09 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI