[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ETYMOLOGY] - Sterile Classes / Sterile Meta Classes

Ilias Lazaridis

5/7/2005 9:12:00 PM

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=steri...

-

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://laz.../case/...

"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" "

.

--
http://laz...
71 Answers

ES

5/7/2005 9:29:00 PM

0


Le 7/5/2005, "Ilias Lazaridis" <ilias@lazaridis.com> blathered:
[snipped]

I wholeheartedly encourage you to find out more about sterilization.

E

--
template<typename duck>
void quack(duck& d) { d.quack(); }



Logan Capaldo

5/7/2005 9:52:00 PM

0

On 5/7/05, Ilias Lazaridis <ilias@lazaridis.com> wrote:
[...]
> * It cannot be instantiated.
[..]
> but Talker is an instance of class "Class".
> the MetaClass "Class:Talker" has no instances.

Regarding SCs (heh, one acronym fits your terminology and the current
terminology) not having instances, while not present in Ruby their is
the idea of the <a
href="http://c2.com/cgi/wiki?AbstractClass"&g... class</a>, (seen
only in C++ AFAIK, although Java's interfaces are similiar in some
respects) which has no instances. This doesn't (debately) make it less
of a class however. Plus one can consider an instance to be some state
(represented by instance variables) and a pointer to the instatiated
classes method lookup table (not sure of the right terminology here).
Then one would would have to consider the instance to be the object
that the SC is an SC of.



Bill Atkins

5/7/2005 9:55:00 PM

0

You are my hero.

On 5/7/05, Saynatkari <ruby-ml@magical-cat.org> wrote:
>
>
> Le 7/5/2005, "Ilias Lazaridis" <ilias@lazaridis.com> blathered:
> [snipped]
>
> I wholeheartedly encourage you to find out more about sterilization.
>
> E
>
> --
> template<typename duck>
> void quack(duck& d) { d.quack(); }
>
>


--
Bill Atkins

Jon A. Lambert

5/7/2005 10:10:00 PM

0

Saynatkari wrote:
> Le 7/5/2005, "Ilias Lazaridis" <ilias@lazaridis.com> blathered:
> [snipped]
>
> I wholeheartedly encourage you to find out more about sterilization.
>

It depends on whether this has a double meaning. Has science discovered a
troll gene? Nature or nurture?
As you might guess I lean towards the nurture side.

On the other meaning...
In the ColdC language, well ColdCore library to be more specific, objects
that are "spawnable" have a "fertile" attribute attached to them. There's
no such thing as a "class" though, just pure objects. Spawned objects
inherit from their parents, while "cloned" objects are siblings in the
inheritance tree. The absence of the "fertile" symbol is similar to Java's
'final'.

--
J Lambert







Nikolai Weibull

5/7/2005 11:58:00 PM

0

Ilias Lazaridis, May 8:

[blah]

What does this have to do with etymology? I don't think you know what
the word "etymology" means. Please refrain from using terms
incorrectly in the future. Thanks,
nikolai

--
Nikolai Weibull: now available free of charge at http:/...!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


Jon A. Lambert

5/8/2005 12:50:00 AM

0

Nikolai Weibull wrote:
> Ilias Lazaridis, May 8:
>
> [blah]
>
> What does this have to do with etymology? I don't think you know what
> the word "etymology" means. Please refrain from using terms
> incorrectly in the future. Thanks,
> nikolai


Mmm... chewy etyms

singleton - an unmarried unattached person - circa 1930's
singleton also refers to a single card of a suit in one's dealt hand in
whist - 1876
single - Old French - sengle "one, separate" - 1300's
Latin singulus "one individual, separate"
Latin diminutive of sim- (stem of simplus) - "simple"
related to simpleton - which brings us full circle and back to Ilias
Lazardis - 2005

;-)

--
J Lambert



Yukihiro Matsumoto

5/8/2005 3:13:00 PM

0

In message "Re: [ETYMOLOGY] - Sterile Classes / Sterile Meta Classes"
on Sun, 8 May 2005 06:14:28 +0900, Ilias Lazaridis <ilias@lazaridis.com> writes:

|Another suggestion for the "Ruby Singleton Classes" or "Exclusive Classes":
|
|Sterile Classes

Sterile means "Not producing or incapable of producing offspring",
right? The word suggest the (class-like) object cannot create its
instances. But this is not the only class-like object in Ruby that
can not (or should not) create its instances, for example, modules in
Ruby are class-like objects which are not capable to instantiate.
Abstract classes as well are classes not supposed to create their
direct instances.

Being hidden from observable object model is not important neither.
In the new model, it would not be hidden any more, and perhaps, there
will be a method to retrieve "singleton class" from an object. I hope
the method name would not be Object#singleton_class.

I'd like to emphasize the "per-object" attribute of the object.
Ideally, the term should be "xxxx class" where

* xxxx describe the class is per-object.
* xxxx is an adjective, or a noun that can be used like adjective.
* we can call methods now we call "singleton methods" as xxxx
methods for consistency.

In this standard, "singleton" is the best I can think of, unless name
conflict. Sad coincidence.

matz.


Ilias Lazaridis

5/8/2005 3:14:00 PM

0

Logan Capaldo wrote:
> On 5/7/05, Ilias Lazaridis <ilias@lazaridis.com> wrote:
> [...]
>
>> * It cannot be instantiated.
>
> [..]
>
>>but Talker is an instance of class "Class".
>>the MetaClass "Class:Talker" has no instances.
>
> Regarding SCs (heh, one acronym fits your terminology and the current
> terminology) not having instances, while not present in Ruby their is
> the idea of the <a
> href="http://c2.com/cgi/wiki?AbstractClass"&g... class</a>, (seen
> only in C++ AFAIK, although Java's interfaces are similiar in some
> respects) which has no instances.

yes, you are right.

there's a collision.

But possibly the term "Abstract Class" is the foundation for a solution.

Dynamic Abstract Class.

> This doesn't (debately) make it less
> of a class however. Plus one can consider an instance to be some state
> (represented by instance variables) and a pointer to the instatiated
> classes method lookup table (not sure of the right terminology here).
> Then one would would have to consider the instance to be the object
> that the SC is an SC of.

I do not understand exactly.

but the essence is in the above about "abstract".

.

--
http://laz...

Bill Guindon

5/8/2005 3:34:00 PM

0

On 5/8/05, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
> In message "Re: [ETYMOLOGY] - Sterile Classes / Sterile Meta Classes"
> on Sun, 8 May 2005 06:14:28 +0900, Ilias Lazaridis <ilias@lazaridis.com> writes:
>
> |Another suggestion for the "Ruby Singleton Classes" or "Exclusive Classes":
> |
> |Sterile Classes
>
> Sterile means "Not producing or incapable of producing offspring",
> right? The word suggest the (class-like) object cannot create its
> instances. But this is not the only class-like object in Ruby that
> can not (or should not) create its instances, for example, modules in
> Ruby are class-like objects which are not capable to instantiate.
> Abstract classes as well are classes not supposed to create their
> direct instances.
>
> Being hidden from observable object model is not important neither.
> In the new model, it would not be hidden any more, and perhaps, there
> will be a method to retrieve "singleton class" from an object. I hope
> the method name would not be Object#singleton_class.
>
> I'd like to emphasize the "per-object" attribute of the object.
> Ideally, the term should be "xxxx class" where
>
> * xxxx describe the class is per-object.
> * xxxx is an adjective, or a noun that can be used like adjective.
> * we can call methods now we call "singleton methods" as xxxx
> methods for consistency.

unique, lone, solo, distinct, specific, custom, customized, changed,
expanded, crafted, decorated, tailored, adapted, adjusted,
transformed, modified.

any of these come close?

> In this standard, "singleton" is the best I can think of, unless name
> conflict. Sad coincidence.
>
> matz.
>
>


--
Bill Guindon (aka aGorilla)



Ilias Lazaridis

5/8/2005 3:38:00 PM

0

Yukihiro Matsumoto wrote:
> In message "Re: [ETYMOLOGY] - Sterile Classes / Sterile Meta Classes"
> on Sun, 8 May 2005 06:14:28 +0900, Ilias Lazaridis <ilias@lazaridis.com> writes:
>
> |Another suggestion for the "Ruby Singleton Classes" or "Exclusive Classes":
> |
> |Sterile Classes
>
> Sterile means "Not producing or incapable of producing offspring",
> right? The word suggest the (class-like) object cannot create its
> instances. But this is not the only class-like object in Ruby that
> can not (or should not) create its instances, for example, modules in
> Ruby are class-like objects which are not capable to instantiate.
> Abstract classes as well are classes not supposed to create their
> direct instances.

yes, the term "Sterile" was finally bad.

> Being hidden from observable object model is not important neither.

Clarification:

by hidden i mean
* not reachable via standard OO-observations (obj.instance-of, class,
superclass, ...)

> In the new model, it would not be hidden any more, and perhaps, there
> will be a method to retrieve "singleton class" from an object. I hope
> the method name would not be Object#singleton_class.

Can I have some more informatin about the new model?

a) method to retrieve "singleton class", Object#singleton_class

further planned changes?

> I'd like to emphasize the "per-object" attribute of the object.
> Ideally, the term should be "xxxx class" where

"xxxx" => "x"
=> "x class"
=> "xclass"

possibly we can agree temporarily "xclass", wher "x" stands for:

> * xxxx describe the class is per-object.
> * xxxx is an adjective, or a noun that can be used like adjective.
> * we can call methods now we call "singleton methods" as xxxx
> methods for consistency.

the above is a nice template.

> In this standard, "singleton" is the best I can think of, unless name
> conflict. Sad coincidence.

I understand your 'pain' - honestly!

.

--
http://laz...