Ilias Lazaridis a écrit :
I've invested some time (whilst ignoring finally the current
documentation) to create this UML diagramm:
http://lazaridis.com/case/lang/ruby/TheRubyObjectModel.png
I'm asking now for confirmation/feedback.
This is nothing special within serious software-development.
-
But as it looks, this community is incapable to do so (giving productive
feedback).
I can.
-
But there are other ways of asking, you know...
-
I'll give it a try: the documentation "ri Class" gives is not wrong at all.
Maybe not complete, but not wrong.
-
In "ri Class" text, if you replace references to "metaclasses" (which are said
to be between parentheses) by "singleton method placeholders", perhaps it
becomes clearer?
-
I remember that what was disturbing you was the stuff about metaclasses. I told
you ruby invite you to think more in terms of singleton method than in terms of
metaclasses. But it seems that you ignore what are singleton methods.
-
Have you ever evaluated some classless OO langages? I know some: IO (
http://www.iolanguage.com/ ), Self (
http://c2.com/cgi/wiki?SelfLanguage ) and
REBOL (rebol is not basically OO, but its OO part is classless.
http://www.rebol.com/ ). If you would, the concept of singleton method would be
far easier to understand for you. (this is actually how I understood that concept)
-
http://lazaridis.com/case/lang/ruby/TheRubyObjectModel.png
Your UML diagram of ruby object model is hard to read, and probably wrong. The
separation between classes in memory and in source code is totally confusing. In
ruby, classes *are* objects. Learn more about classless languages, and it should
be far easier to understand these concepts.
There is another evident mistake in your UML diagram. Object doesn't inherit
from nil, nil is a literal and an instance of NilClass which inherit from Object.
-
I tried my best, I can't say anymore. Please, don't ask me for lengthy
exhausting explanations. Try the languages I told you about, they are really
worth it.
-
Have a nice day.