lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Thu, Dec 24, 2009 at 3:37 AM, spir <> wrote:
> Unless _all_ metamethods are systematically copied to new objects -- but I haven't yet seen this kind of (non-)inheritance.

that's what steve called fat metatable.  BTW, Ii don't think it's an
official name, but it's common enough that most of us understand what
he meant.

> This means all objects carry, in particuliar, (references to) what is defined in the OO framework's root object, which can be heavy.

<warning pov="personal">

in dynamic languages, OO frameworks tend to be 'shallow' (not too many
levels of inhenitance) and often without a single root.  if you find
yourself implementing a big library in your root object, it probably
means you don't really feel comfortable with the language.

it's worth noting that most of us have at some point written some OO
framework, most of those get abandoned a few months later, when we
come to embrace a lighter, less class-based style.  Remember, OOD is a
style, not a language feature.

in my case, my objects tend to be just the encapsulation of state and
a few convenience methods.  polymorphism is only incidental,
inheritance is a _very_ rare sighting.  for that, you don't need any
framework, just a few repeating patterns to make it easy to read the
'hand crafting' of classes.