Go to Page... |
Compatibility: | Classic Patch (1.13.6) |
Updated: | 12-22-20 08:41 AM |
Created: | 08-23-17 03:23 PM |
Downloads: | 1,803 |
Favorites: | 1 |
MD5: | |
Categories: | Libraries, Developer Utilities |
⚫ About
MayronObjects is a framework designed to make object-oriented programming (OOP) easier for Lua developers.
The framework is designed for World of Warcraft addon development and supports both Classic and Retail.
• Create classes and instantiate new instance objects modeled from those classes.
• Protect private instance data - Each instance of a class has its own unique private instance data table that cannot be accessed outside the scope of class functions unless the developer chooses to do so. MayronObjects automatically injects this table as the first parameter for all class methods when called from an instance object.
• Define and enforce strict typing rules for class method parameters and return value types. MayronObjects will detect invalid arguments passed to method parameters or returned from a method and will raise helpful Lua errors for the developer to fix. Checking for unexpected behavior improves the development experience and results in fewer bugs published and discovered by your users.
• Define private and static class methods. Private methods must be called from the private data table using a unique Call method. Developers must call static methods from the class table itself. Both private and static methods support strict typing rules.
• Create interfaces to enforce strict method and property rules to be implemented by classes and instances.
• Define default parameter values, including both primitive types (strings and numbers) and complex types (tables, functions, Blizzard widgets, and other classes and interfaces).
• Create reusable generic classes - Instances of a generic Class can specify the types to be used for generic parameter types defined by the generic class. Generic Classes allow developers to reuse the same class logic for multiple purposes, such as creating a list data structure that only works with number values and another list using the same class to only support string values.
• Define attributes and attach them to class methods to apply pre-execution logic. Attributes can manipulate argument values before being passed to class method parameters. Attributes can also prevent class method executions if custom attribute conditions fail.
• Create, export, and import packages containing entities, such as classes, interfaces, and attributes, to be shared with other developers.
How Inheritance Works:
Each class can inherit from at most one parent class but can implement multiple interfaces. All classes either directly or indirectly inherit from the base Object class, which provides many useful functions that all instances of any class can access.
Collection Classes:
The framework also comes with standard collection classes (List, Stack, Map, LinkedList). You can remove these collection classes if you do not require them (make sure to also remove references to them insideMayronObjects.xml).
Demos:
There is a Test.lua file included in the MayronObjects folder to see other working examples of how to use this framework.
For the full maintained documentation, please visit:
mayronui.com/p/mayron-objects
For help and support, please visit the MayronUI discord server:
https://discord.gg/8Kh3maU
Comment Options |
12-17-20, 10:33 AM | |
|
All documentation on the website has been updated to reflect the below changes:
3.1.4
3.1.3
3.1.2
Please see section 4.3, Variable List Definitions, in the documentation for details on how to use this feature: https://mayronui.com/p/mayron-object...t-typing-rules
Last edited by Mayron : 12-19-20 at 08:59 AM.
|
|
Mayron |
View Public Profile |
Send a private message to Mayron |
Find More Posts by Mayron |
Add Mayron to Your Buddy List |
12-05-20, 05:38 PM | |
|
All of the documentation has been updated: Visit: https://mayronui.com/p/mayron-objects to read it!
Change Log 3.1.0
This is a major update. Please read the documentation on the official website for instructions on how to use the new private functions and static function features. Also, you now get the framework using: Lua Code:
Instead of using LibStub. There is a reason for the change but it's only to deal with edge cases I was finding when using it in MayronUI.
Last edited by Mayron : 12-06-20 at 05:31 AM.
|
|
Mayron |
View Public Profile |
Send a private message to Mayron |
Find More Posts by Mayron |
Add Mayron to Your Buddy List |
You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.