From: Robert Klemme Date: 2004-12-31T04:21:43+09:00 Subject: Re: Inheritance of class variables "Eustaquio Rangel de Oliveira Jr." schrieb im Newsbeitrag news:41D43A27.6070108@yahoo.com... > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi! > > | I would probably model your example completely different, because Honda > | and Ford are really instances of CarBuilder not really sub classes. So > | this is the result and suddenly we don't need class vars any more: > > Thanks for your example! I'm learning about Ruby and taking notes to make > a > begginer's tutorial, so while the Guy example really help me to go deep > inside the Ruby depths and think about all that stuff there (wow Guy I was > really amazed with the concept of creating a instance variable there!), > your example is easier for newbies (like me, also) to understand. But please note that my point was not so much about Ruby but about OO modeling. Honda, Ford and others are really instances of CarBuilder. That's why you just need one class. Of course, if you had different kinds of CarBuilders with different capabilities (say LorryCarBuilder, SedanCarbuilder, SUVCarBuilder and SportsWagonCarBuilder) you would need several classes; but even then Ford would be an instance of LorryCarBuilder (or whatever) which normally would inherit CarBuilder. > Thanks! You're welcome! I'm glad I could be of any help. Regards robert