[rhg-discussion] please review ch04-diagram02

Meinrad Recheis meinrad.recheis at gmail.com
Mon Mar 20 13:14:59 EST 2006

On 3/20/06, Vincent Isambart <vincent.isambart at gmail.com> wrote:
> Hi,
> > i made two variants of chapter04-diagram02. i have a suggestion that
> > is quite different from the original but i think it's representing
> > things more exactly, so i am asking for your opinions.
> Well, the second version looks better, but I think it does not have
> the intended meaning. You should mix both, replacing the names
> "Object" and "Class" by "obj", "obj.class", "Class", "Class".
> I think the intended meaning is that you take any object, you follow
> the class link you get its class, and if you follow the class link of
> this class you get Class, if you follow the class link of Class you
> get Class...
> Was I clear?

let me shortly explain what i mean. look at the irb session

irb(main):001:0> obj=Object.new
=> #<Object:0xb7baf390>
irb(main):002:0> obj.class
=> Object
irb(main):003:0> obj.class.class
=> Class
irb(main):004:0> obj.class.class.class
=> Class
irb(main):005:0> ...

any object's class is not Class in general but some subclass of
Object. Object#class is Class and Class#class is Class. My variant
leaves out the unimportant variable name "obj". And it shows the same
thing: the infinite loop of Class's Class using a notation where an
object is represented by its classname (in white) and its methods of
concern (#class in our case).

my intent is to develop a reasonable representation for the presented
things that i can use in all diagrams.

the original uses boxes for everything: variables, expressions,
structs, objects, classes. i tried to introduce different
representation for different things (a clear visual language) but it
complicates things. it's harder to be exact, and the exact intent of
the author needs to be understood to choose the right representation.

maybe i should just style the originals a bit and don't try to
exactify them in their representation. would also be less work for me
to do.
it's up to you. i won't force it. if you think the other is better, i
strictly copy the originals.

-- henon

More information about the rhg-discussion mailing list