I
Ilias Lazaridis
Another suggestion for the "Ruby Singleton Classes" or "Exclusive Classes":
Sterile Classes
Class: keeps structure and behaviour
Sterile: cannot create ( instances / objects )
The Term is currently unassigned:
http://www.google.com/search?q=sterile+classes
-
Concept of a "Sterile Class":
A Sterile Class is a Class, with all the abilities of the languages
Classes, exept:
* It cannot be instantiated.
* It is not part of the observable object-model
In Ruby, Sterile Classes are used to change the behaviour of _one_ object.
The Sterile Class
* becomes _not_ part of the observable inheritance-chain.
* e.g.: cannot be reached via
obj.class,
obj.superclass,
obj.instance_of [...]
* _becomes_ part of the non-observable inheritance-chain.
* e.g.: method-resolution looks _first_ at the "Sterile Class"
* internal implementation
[Thus, "Pseudo Class" would be possibly a right term, too - but already
used within CSS domain]
-
please look at the 1.3 version of the Diagramm:
http://lazaridis.com/case/lang/ruby/
"john" has an "Exclusive Sterile Class"
"john" is an instance of "Talker"
"john" has _no_ observable relation to its "Exclusive Sterile Class"
[observable via OOAD]
=> "[Exclusive] Sterile Class"
=> "Sterile Class"
-
"Talker" has an "Sterile Class" (Class:Talker)
"Class:Talker" keeps the structure and behaviour of class Talker.
thus "Class:Talker" is the "MetaClass" of class Talker.
=> MetaClass
but Talker is an instance of class "Class".
the MetaClass "Class:Talker" has no instances.
=> "Sterile Meta Class"
-
The terminology depends finally on the further development direction of
Ruby.
If it is planned to make the object model more OO like, and to implement
_real_ metaclasses, then it would be enouth to say:
"Attention: In the current implementation, a Ruby MetaClass is based on
"Sterile Classes". Although they describe structure and behaviour of a
Class, they do not instantiate those classes. They are _not_ part of the
inheritance-tree and thus _not_ part of the object-model. That's why the
documentation referes them as "Sterile Meta Classes" "
..
Sterile Classes
Class: keeps structure and behaviour
Sterile: cannot create ( instances / objects )
The Term is currently unassigned:
http://www.google.com/search?q=sterile+classes
-
Concept of a "Sterile Class":
A Sterile Class is a Class, with all the abilities of the languages
Classes, exept:
* It cannot be instantiated.
* It is not part of the observable object-model
In Ruby, Sterile Classes are used to change the behaviour of _one_ object.
The Sterile Class
* becomes _not_ part of the observable inheritance-chain.
* e.g.: cannot be reached via
obj.class,
obj.superclass,
obj.instance_of [...]
* _becomes_ part of the non-observable inheritance-chain.
* e.g.: method-resolution looks _first_ at the "Sterile Class"
* internal implementation
[Thus, "Pseudo Class" would be possibly a right term, too - but already
used within CSS domain]
-
please look at the 1.3 version of the Diagramm:
http://lazaridis.com/case/lang/ruby/
"john" has an "Exclusive Sterile Class"
"john" is an instance of "Talker"
"john" has _no_ observable relation to its "Exclusive Sterile Class"
[observable via OOAD]
=> "[Exclusive] Sterile Class"
=> "Sterile Class"
-
"Talker" has an "Sterile Class" (Class:Talker)
"Class:Talker" keeps the structure and behaviour of class Talker.
thus "Class:Talker" is the "MetaClass" of class Talker.
=> MetaClass
but Talker is an instance of class "Class".
the MetaClass "Class:Talker" has no instances.
=> "Sterile Meta Class"
-
The terminology depends finally on the further development direction of
Ruby.
If it is planned to make the object model more OO like, and to implement
_real_ metaclasses, then it would be enouth to say:
"Attention: In the current implementation, a Ruby MetaClass is based on
"Sterile Classes". Although they describe structure and behaviour of a
Class, they do not instantiate those classes. They are _not_ part of the
inheritance-tree and thus _not_ part of the object-model. That's why the
documentation referes them as "Sterile Meta Classes" "
..