discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Programming it's a play


From: Dennis Leeuw
Subject: Re: Programming it's a play
Date: Sat, 20 Sep 2003 19:44:20 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1

Hi Nicolas,

Nicolas Roard wrote:
On 2003-09-20 15:44:49 +0000 Dennis Leeuw <dleeuw@made-it.com> wrote:

Hi all,

I picked up working at the Objective-C programming guide. The last couple of weeks I have been working on the Guide and have been reading a lot of documentation. The more I read the less happy I was with the Wheel example off the current Guide for Classes and Objects.

So I need an new idea. The following is what I came up with to explain the OO programing terms. I would like people to review the following text to see if that can be used as an explanation of Objective-C programming.


Well, the actor metaphor is a good one, mainly to explain polymorphism.
But I'm not very fond of of the metaphor a Class == an Actor, and
an Object == an Actor's performance ...
Because generally, objects (classes instances) are considered as living entities, acting on their own -- it doesn't fit well with a performance of the same actor somewhat,
as they generally don't happen at the same time and don't cooperate :-)
I would prefers the metaphor a Class == an actor school, an Object == an actor.


My problem here (and the main reason why invented the actor story) is the fact that (atleast in Objective-C) a class is an object as soon as it is compiled, since you can send it a message of new.

And that is not something I can do with school. If I would send a new message to school I 1) get a new school or 2) would get an actor, 3) school sends out an actor.

1) Is not what I want
2) Has a name change (school gets actor) which is also not what happens in Objective-C 3) This is also, as far as I understand it, not what happens. The class object instantiates an object which is a copy of itself with (possibly) it's instance variables changed. But the methods are always identical. While the methods of a school and an actor are not identical.

Please correct me if I am wrong since it is only since today that I feel I realy understand the difference between a Class, a Class object, an Object and an Instance.

Which to me, and I have noticed to more beginners, is a very confusing concept. So enlightenment is very much welcomed.

And it might be that I am wrong on the feeling part :)

Thanks for the input,

Dennis





reply via email to

[Prev in Thread] Current Thread [Next in Thread]