Class Models for Lua

# Introduction

Although LOOP is currently being used in a couple of projects (e.g. OiL) and you might use it in your own projects, it is provided here primarily as a resource to learn Lua, in particular OOP (object-oriented programming) in Lua. Therefore, the ideal is that you take some time to actually study Lua prior to learn and use LOOP. An excellent starting point is the Programming in Lua book.

Usually, it is not a good idea to use LOOP if you do not know Lua very well. Similarly, you generally should not use LOOP just to emulate in Lua solutions that are particularly suitable for object-oriented languages. This is because Lua provides mechanisms more powerful and flexible than classes or other popular OO concepts (check out the examples in the book mentioned above). Therefore, it is wise to first learn the language and then keep OO techniques as one of many useful resources to use in your code. Once you feel comfortable with Lua's features (you do not need to become an expert), you shall study and use the LOOP models. You may also change or extend them to suit different situations, or evaluate and compare them to other or your own class models. Most implementations of LOOP models are quite simple and minimalist, therefore they are easy to learn and understand.

On the other hand, if you do not have the time now to learn Lua, but want to find out whether you can do OOP in Lua, then take a quick look on the rest of this User Manual and browse the Class Library. There, you will find a wide variety of examples of OOP in Lua. However, keep in mind that LOOP models are just one possibility of OOP in Lua and it is generally possible to emulate OOP models of other languages in Lua, as done elsewhere.

Copyright (C) 2004-2008 Tecgraf, PUC-Rio

This project is currently being maintained by Tecgraf at PUC-Rio.